mirror of
https://github.com/hanzoai/ui.git
synced 2026-11-21 00:18:41 +00:00
22 lines
898 B
TypeScript
22 lines
898 B
TypeScript
import type { HanzoUserInfo } from "../types"
|
|
|
|
type AuthProvider = 'google' | 'facebook' | 'github'
|
|
|
|
interface AuthService {
|
|
|
|
get loggedIn(): boolean
|
|
get user(): HanzoUserInfo | null // returns current info obj // all fields observable :)
|
|
|
|
signupEmailAndPassword: ( email: string, password: string ) => Promise<{success: boolean, userInfo: HanzoUserInfo | null, message?: string}>
|
|
loginEmailAndPassword: ( email: string, password: string ) => Promise<{success: boolean, userInfo: HanzoUserInfo | null, message?: string}>
|
|
loginWithProvider: ( provider: AuthProvider ) => Promise<{success: boolean, userInfo: HanzoUserInfo | null}>
|
|
loginWithCustomToken: ( token: string ) => Promise<{success: boolean, userInfo: HanzoUserInfo | null}>
|
|
associateWallet: () => Promise<void>
|
|
logout: () => Promise<{success: boolean}>
|
|
}
|
|
|
|
export {
|
|
type AuthService as default,
|
|
type AuthProvider
|
|
}
|