Add Authentik sign-in, fix tab scroll insets, and polish multi-account auth.
Mobile app detects SSO per server, supports OAuth sign-in, and preserves saved sessions when adding accounts. Tab screens get proper chrome layout and tab-bar clearance with scrollable page headers. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -41,6 +41,33 @@ export async function migrateAuthStorage(fromPrefix: string, toPrefix: string):
|
||||
);
|
||||
}
|
||||
|
||||
export async function clearAuthStorage(prefix: string): Promise<void> {
|
||||
await Promise.all(
|
||||
AUTH_STORAGE_SUFFIXES.map(async (suffix) => {
|
||||
const key = storageKeyForPrefix(prefix, suffix);
|
||||
const value = await SecureStore.getItemAsync(key);
|
||||
|
||||
if (value?.startsWith(CHUNK_MARKER)) {
|
||||
const count = Number(value.slice(CHUNK_MARKER.length));
|
||||
if (Number.isInteger(count) && count > 0) {
|
||||
await Promise.all(
|
||||
Array.from({ length: count }, (_, index) =>
|
||||
SecureStore.deleteItemAsync(`${key}.${index}`),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
await SecureStore.deleteItemAsync(key);
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
/** Clears guest auth storage before signing into an additional account. */
|
||||
export async function prepareForAdditionalSignIn(): Promise<void> {
|
||||
await clearAuthStorage(GUEST_AUTH_STORAGE_PREFIX);
|
||||
}
|
||||
|
||||
export async function finalizeAuthenticatedAccount(input: {
|
||||
apiUrl: string;
|
||||
userId: string;
|
||||
|
||||
Reference in New Issue
Block a user