auth

package
v2.3.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

type Authenticator struct {
	// contains filtered or unexported fields
}

Authenticator is a utility for performing authentication of the given user. It carries necessary metadata for spinning up a local server alongside channels for errors and when authentication is "done".

func NewAuthenticator

func NewAuthenticator() *Authenticator

NewAuthenticator returns a new Authenticator for the caller with instantiated channels

func (*Authenticator) CheckSession

func (a *Authenticator) CheckSession() error

CheckSession checks if a session is already authenticated based on the expiration time for the given session on disk.

func (*Authenticator) GetSessionToken

func (a *Authenticator) GetSessionToken() (string, error)

GetSessionToken returns the access token for a given session

func (*Authenticator) Login

func (a *Authenticator) Login() (string, error)

Login performs the login flow for a user. This flow uses Supabase auth and a local server for handling the login. Once the server has completed and received the session, the server is shut down and control is returned back to the CLI.

Jump to

Keyboard shortcuts

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