auth

package
v1.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoginWithBrowser

func LoginWithBrowser(cfg *config.Config, provider string) error

LoginWithBrowser initiates browser-based OAuth flow

func LoginWithToken

func LoginWithToken(cfg *config.Config, token string) error

LoginWithToken sets an auth token manually

func Logout

func Logout(cfg *config.Config) error

Logout clears the auth token

Types

type AuthResponse

type AuthResponse struct {
	AccessToken  string `json:"access_token"`
	TokenType    string `json:"token_type"`
	ExpiresIn    int    `json:"expires_in"`
	RefreshToken string `json:"refresh_token"`
	User         User   `json:"user"`
}

AuthResponse represents the auth callback response

type User

type User struct {
	ID    string `json:"id"`
	Email string `json:"email"`
}

User represents a Supabase user

func GetUserInfo

func GetUserInfo(cfg *config.Config) (*User, error)

GetUserInfo gets information about the authenticated user

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL