Documentation ¶
Index ¶
- Constants
- type Auth
- func (a *Auth) InviteUserByEmail(ctx context.Context, email string) (*User, error)
- func (a *Auth) RefreshUser(ctx context.Context, userToken string, refreshToken string) (*AuthenticatedDetails, error)
- func (a *Auth) ResetPasswordForEmail(ctx context.Context, email string) error
- func (a *Auth) SendMagicLink(ctx context.Context, email string) error
- func (a *Auth) SignIn(ctx context.Context, credentials UserCredentials) (*AuthenticatedDetails, error)
- func (a *Auth) SignInWithProvider(opts ProviderSignInOptions) (*ProviderSignInDetails, error)
- func (a *Auth) SignOut(ctx context.Context, userToken string) error
- func (a *Auth) SignUp(ctx context.Context, credentials UserCredentials) (*User, error)
- func (a *Auth) UpdateUser(ctx context.Context, userToken string, updateData map[string]interface{}) (*User, error)
- func (a *Auth) User(ctx context.Context, userToken string) (*User, error)
- type AuthenticatedDetails
- type Client
- type ErrorResponse
- type ProviderSignInDetails
- type ProviderSignInOptions
- type User
- type UserCredentials
Constants ¶
View Source
const ( AuthEndpoint = "auth/v1" RestEndpoint = "rest/v1" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
func (*Auth) InviteUserByEmail ¶
InviteUserByEmail sends an invite link to the given email. Returns a user.
func (*Auth) RefreshUser ¶
func (a *Auth) RefreshUser(ctx context.Context, userToken string, refreshToken string) (*AuthenticatedDetails, error)
SignIn enteres the user credentials and returns the current user if succeeded.
func (*Auth) ResetPasswordForEmail ¶
ResetPasswordForEmail sends a password recovery link to the given e-mail address.
func (*Auth) SendMagicLink ¶
SendMagicLink sends a link to a specific e-mail address for passwordless auth.
func (*Auth) SignIn ¶
func (a *Auth) SignIn(ctx context.Context, credentials UserCredentials) (*AuthenticatedDetails, error)
SignIn enters the user credentials and returns the current user if succeeded.
func (*Auth) SignInWithProvider ¶
func (a *Auth) SignInWithProvider(opts ProviderSignInOptions) (*ProviderSignInDetails, error)
SignInWithProvider returns a URL for signing in via OAuth
type AuthenticatedDetails ¶
type Client ¶
type Client struct { BaseURL string HTTPClient *http.Client Auth *Auth DB *postgrest.Client // contains filtered or unexported fields }
func CreateClient ¶
CreateClient creates a new Supabase client
type ErrorResponse ¶
func (*ErrorResponse) Error ¶
func (err *ErrorResponse) Error() string
type ProviderSignInDetails ¶
type ProviderSignInOptions ¶
type User ¶
type User struct { ID string `json:"id"` Aud string `json:"aud"` Role string `json:"role"` Email string `json:"email"` InvitedAt time.Time `json:"invited_at"` ConfirmedAt time.Time `json:"confirmed_at"` ConfirmationSentAt time.Time `json:"confirmation_sent_at"` AppMetadata struct { // contains filtered or unexported fields } `json:"app_metadata"` UserMetadata map[string]interface{} `json:"user_metadata"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
type UserCredentials ¶
Click to show internal directories.
Click to hide internal directories.