Supabase.GoTrue (supabase_gotrue v0.3.2)
This module provides the functionality to interact with the GoTrue API, allowing management of users, sessions, and authentication.
It also aims to provide integrations with Plug and Phoenix LiveView applications.
For detailed information about the GoTrue API, check the official documentation at https://supabase.io/docs/reference/javascript/auth-api
And also refer to functions and submodules documentation for more information.
Summary
Functions
Get the user associated with the current session.
Signs in a user with ID token.
Signs in a user with OAuth.
Signs in a user with OTP.
Signs in a user with email/phone and password.
Signs in a user with SSO.
Signs up a user with email/phone and password.
Verifies an OTP code.
Types
client()
@opaque client()
Functions
get_user(client, session)
Get the user associated with the current session.
Parameters
client- TheSupabaseclient to use for the request.session- The session to use for the request. CheckSupabase.GoTrue.Sessionfor more information.
Examples
iex> session = %Supabase.GoTrue.Session{access_token: "example_token"}
iex> Supabase.GoTrue.get_user(pid | client_name, session)
{:ok, %Supabase.GoTrue.User{}}
sign_in_with_id_token(client, credentials)
Signs in a user with ID token.
Parameters
client- TheSupabaseclient to use for the request.credentials- The credentials to use for the sign in. CheckSupabase.GoTrue.Schemas.SignInWithIdTokenfor more information.
Examples
iex> credentials = %Supabase.GoTrue.SignInWithIdToken{}
iex> Supabase.GoTrue.sign_in_with_id_token(pid | client_name, credentials)
{:ok, %Supabase.GoTrue.User{}}
sign_in_with_oauth(client, credentials)
Signs in a user with OAuth.
Parameters
client- TheSupabaseclient to use for the request.credentials- The credentials to use for the sign in. CheckSupabase.GoTrue.Schemas.SignInWithOauthfor more information.
Examples
iex> credentials = %Supabase.GoTrue.SignInWithOauth{}
iex> Supabase.GoTrue.sign_in_with_oauth(pid | client_name, credentials)
{:ok, atom, URI.t()}
sign_in_with_otp(client, credentials)
Signs in a user with OTP.
Parameters
client- TheSupabaseclient to use for the request.credentials- The credentials to use for the sign in. CheckSupabase.GoTrue.Schemas.SignInWithOTPfor more information.
Examples
iex> credentials = %Supabase.GoTrue.SignInWithOTP{}
iex> Supabase.GoTrue.sign_in_with_otp(pid | client_name, credentials)
{:ok, %Supabase.GoTrue.Session{}}
sign_in_with_password(client, credentials)
Signs in a user with email/phone and password.
Parameters
client- TheSupabaseclient to use for the request.credentials- The credentials to use for the sign in. CheckSupabase.GoTrue.Schemas.SignInWithPasswordfor more information.
Examples
iex> credentials = %Supabase.GoTrue.SignInWithPassword{}
iex> Supabase.GoTrue.sign_in_with_password(pid | client_name, credentials)
{:ok, %Supabase.GoTrue.Session{}}
sign_in_with_sso(client, credentials)
Signs in a user with SSO.
Parameters
client- TheSupabaseclient to use for the request.credentials- The credentials to use for the sign in. CheckSupabase.GoTrue.Schemas.SignInWithSSOfor more information.
Examples
iex> credentials = %Supabase.GoTrue.SignInWithSSO{}
iex> Supabase.GoTrue.sign_in_with_sso(pid | client_name, credentials)
{:ok, %Supabase.GoTrue.User{}}
sign_up(client, credentials)
Signs up a user with email/phone and password.
Parameters
client- TheSupabaseclient to use for the request.credentials- The credentials to use for the sign up. CheckSupabase.GoTrue.Schemas.SignUpWithPasswordfor more information.
Examples
iex> credentials = %Supabase.GoTrue.SignUpWithPassword{}
iex> Supabase.GoTrue.sign_up(pid | client_name, credentials)
{:ok, %Supabase.GoTrue.User{}}
verify_otp(client, params)
Verifies an OTP code.
Parameters
client- TheSupabaseclient to use for the request.params- The parameters to use for the verification. CheckSupabase.GoTrue.Schemas.VerifyOTPfor more information.
Examples
iex> params = %Supabase.GoTrue.VerifyOTP{}
iex> Supabase.GoTrue.verify_otp(pid | client_name, params)
{:ok, %Supabase.GoTrue.Session{}}