Merge branch 't3/upgrade-expo-sdk-58' into t3/pocketbase-token-refresh
Keep automatic token refresh and clear the device widget on logout. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
43 files changed
+852
-1070
No files matched your search
@@ -3,6 +3,7 @@ import { AppState } from 'react-native';
|
||||
import AsyncStorage from '@react-native-async-storage/async-storage';
|
||||
import api, { isAuthCollection, isRevokedAuthError } from '../services/api';
|
||||
import { getJwtExpiryMs } from '../services/jwtExpiry';
|
||||
import { syncDevicesToWidget } from '../services/widgetSync';
|
||||
import { AuthResponse, User } from '../types';
|
||||
|
||||
interface AuthContextType {
|
||||
@@ -311,6 +312,7 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ children
|
||||
const logout = async () => {
|
||||
try {
|
||||
await clearSession();
|
||||
syncDevicesToWidget([]);
|
||||
} catch (error) {
|
||||
console.error('Failed to logout', error);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user