App chrash + seo
This commit is contained in:
@@ -96,11 +96,15 @@ export const AuthService = {
|
||||
const raw = await SecureStore.getItemAsync(SESSION_KEY);
|
||||
if (!raw) return null;
|
||||
const parsed = JSON.parse(raw) as Partial<AuthSession>;
|
||||
if (!parsed.token || !parsed.serverUserId || !parsed.userId) {
|
||||
await clearStoredSession();
|
||||
return null;
|
||||
}
|
||||
return parsed as AuthSession;
|
||||
if (!parsed.token || !parsed.serverUserId || !parsed.userId) {
|
||||
await clearStoredSession();
|
||||
return null;
|
||||
}
|
||||
if (!AuthDb.getUserById(parsed.userId)) {
|
||||
await clearStoredSession();
|
||||
return null;
|
||||
}
|
||||
return parsed as AuthSession;
|
||||
} catch {
|
||||
await clearStoredSession();
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user