auth
import "github.com/nickrucinski/cloverapi/internal/auth"
Index
- func GenerateAnonCode() string
- func InitiateProviderLogin(provider, redirectToURL string) (string, error)
- type LoginRequest
- type SignUpRequest
- type SupabaseLoginResponse
- type SupabaseSignUpResponse
func GenerateAnonCode
func GenerateAnonCode() string
Generates the code for an anonymous user
func InitiateProviderLogin
func InitiateProviderLogin(provider, redirectToURL string) (string, error)
Handles the provider login Mostly generic so we can add more later
type LoginRequest
type LoginRequest struct {
Email string `json:"email"`
Password string `json:"password"`
}
type SignUpRequest
type SignUpRequest struct {
Email string `json:"email"`
Password string `json:"password"`
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
}
type SupabaseLoginResponse
type SupabaseLoginResponse struct {
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token"`
User models.User `json:"user"`
}
func LoginWithEmailAndPassword
func LoginWithEmailAndPassword(email, password string) (*SupabaseLoginResponse, error)
Login with your email and password
type SupabaseSignUpResponse
type SupabaseSignUpResponse struct {
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token"`
User models.User `json:"user"`
}
func SignUpWithEmailAndPassword
func SignUpWithEmailAndPassword(email, password, firstName, lastName string) (*SupabaseSignUpResponse, error)
Sign up a user with email, password, first name, and last name TODO Check if the user already has an account
Generated by gomarkdoc