Module

Supabase.Auth

Package
purescript-supabase
Repository
i-am-the-slime/purescript-supabase

#FunctionResponse Source

type FunctionResponse d = { data :: Maybe d, error :: Maybe { message :: String } }

#SignInWithOAuthOptions Source

type SignInWithOAuthOptions :: Row Typetype SignInWithOAuthOptions = (options :: { queryParams :: Foreign, redirectTo :: String, scopes :: String }, provider :: OAuthProvider)

#getSession Source

getSession :: Client -> Aff { data :: { session :: Maybe Session }, error :: Maybe AuthError }

#getUser Source

getUser :: Client -> Aff { data :: { user :: Maybe User }, error :: Maybe AuthError }

#invoke Source

invoke :: forall t body headers. ReadForeign t => WriteForeign body => WriteForeign headers => FunctionName -> body -> headers -> Client -> Aff (FunctionResponse t)

#onAuthStateChange Source

onAuthStateChange :: (Maybe Session -> Effect Unit) -> Client -> Effect { data :: { subscription :: { id :: String, unsubscribe :: Effect Unit } } }

#reauthenticate Source

#removeAllChannels Source

#resetPasswordForEmail Source

#setSession Source

setSession :: { access_token :: AccessToken, refresh_token :: RefreshToken } -> Client -> Aff AuthResponse

#signInWithEmail Source

signInWithEmail :: { email :: UserEmail, password :: UserPassword } -> Client -> Aff AuthResponse

#signInWithIdToken Source

signInWithIdToken :: { provider :: OAuthProvider, token :: IdToken } -> Client -> Aff AuthResponse

#signInWithOAuth Source

signInWithOAuth :: forall opts thru. Union opts thru SignInWithOAuthOptions => WriteForeign (Record opts) => Record opts -> Client -> Aff { data :: { provider :: OAuthProvider, url :: Maybe String }, error :: Maybe AuthError }

#signInWithPhone Source

signInWithPhone :: { password :: UserPassword, phone :: UserPhone } -> Client -> Aff AuthResponse

#signInWithSSO Source

signInWithSSO :: { domain :: SSODomain } -> Client -> Aff { data :: { url :: Maybe String }, error :: Maybe AuthError }

#signOut Source

signOut :: Client -> Aff { error :: Maybe AuthError }

#signUpWithEmail Source

signUpWithEmail :: { email :: UserEmail, password :: UserPassword } -> Client -> Aff AuthResponse

#signUpWithPhone Source

signUpWithPhone :: { password :: UserPassword, phone :: UserPhone } -> Client -> Aff AuthResponse

#sendOtpToEmail Source

#sendOtpToPhone Source

#updateUser Source

#verifyEmailOtp Source

verifyEmailOtp :: { email :: UserEmail, token :: OTPToken, type :: OTPType } -> Client -> Aff AuthResponse

#verifyPhoneOtp Source

verifyPhoneOtp :: { phone :: UserPhone, token :: OTPToken, type :: OTPType } -> Client -> Aff AuthResponse

Re-exports from Supabase.Auth.Types

#User Source

type User = { app_metadata :: Foreign, aud :: String, created_at :: Timestamp, email :: UserEmail, id :: UserId, role :: String, updated_at :: Timestamp, user_metadata :: Foreign }

#Session Source

type Session = { access_token :: AccessToken, expires_at :: Int, expires_in :: Int, refresh_token :: RefreshToken, token_type :: String, user :: User }

#OTPType Source

data OTPType

Instances

#AuthResult Source

type AuthResult = { session :: Maybe Session, user :: Maybe User }

#AuthResponse Source

type AuthResponse = { data :: AuthResult, error :: Maybe AuthError }

#AuthError Source

type AuthError = { message :: String, status :: Maybe Int }

#otpTypeToString Source