feat(release): prepare 1.1.0 candidate
This commit is contained in:
parent
5a34f66981
commit
5205dcdfa9
736 changed files with 115667 additions and 12203 deletions
27
apps/mobile-rn/src/lib/logout.ts
Normal file
27
apps/mobile-rn/src/lib/logout.ts
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import { supabase } from './supabase'
|
||||
|
||||
export interface LocalLogoutResult {
|
||||
remoteRevocationConfirmed: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempts server-side refresh-token revocation first, then always performs
|
||||
* the caller's local secure purge. A network outage must not trap a user in a
|
||||
* signed-in device or leave a reusable refresh token in local storage.
|
||||
*/
|
||||
export async function signOutWithLocalFallback(
|
||||
purgeLocalSession: () => Promise<void>,
|
||||
): Promise<LocalLogoutResult> {
|
||||
let remoteRevocationConfirmed = false
|
||||
try {
|
||||
const { error } = await supabase.auth.signOut()
|
||||
remoteRevocationConfirmed = error === null
|
||||
} catch {
|
||||
remoteRevocationConfirmed = false
|
||||
}
|
||||
|
||||
// This remains fatal: the UI must never claim local logout if Keychain
|
||||
// deletion itself failed.
|
||||
await purgeLocalSession()
|
||||
return { remoteRevocationConfirmed }
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue