mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
at verify-code 1.1 kB view raw
1import {LogEvents} from '#/lib/statsig/statsig' 2import {PersistedAccount} from '#/state/persisted' 3 4export type SessionAccount = PersistedAccount 5 6export type SessionStateContext = { 7 accounts: SessionAccount[] 8 currentAccount: SessionAccount | undefined 9 hasSession: boolean 10} 11 12export type SessionApiContext = { 13 createAccount: (props: { 14 service: string 15 email: string 16 password: string 17 handle: string 18 birthDate: Date 19 inviteCode?: string 20 verificationPhone?: string 21 verificationCode?: string 22 }) => Promise<void> 23 login: ( 24 props: { 25 service: string 26 identifier: string 27 password: string 28 authFactorToken?: string | undefined 29 }, 30 logContext: LogEvents['account:loggedIn']['logContext'], 31 ) => Promise<void> 32 logoutCurrentAccount: ( 33 logContext: LogEvents['account:loggedOut']['logContext'], 34 ) => void 35 logoutEveryAccount: ( 36 logContext: LogEvents['account:loggedOut']['logContext'], 37 ) => void 38 resumeSession: (account: SessionAccount) => Promise<void> 39 removeAccount: (account: SessionAccount) => void 40}