auth

package
v0.1.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2025 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

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

func New

func New(db *bun.DB) *Auth

func (*Auth) Callback

func (a *Auth) Callback(code string) *oauth2.Token

func (*Auth) CreateAdminUser

func (a *Auth) CreateAdminUser() error

func (*Auth) CreateSessionCookie

func (a *Auth) CreateSessionCookie(sessionID string) *http.Cookie

func (*Auth) LoginUser

func (a *Auth) LoginUser(ctx context.Context, username, password string) (string, error)

Login uses email and password to authenticate the user

func (*Auth) OAuthLogin

func (a *Auth) OAuthLogin() string

OAuthLogin uses OAuth2 to authenticate the user This will probably work as register and login, right???

func (*Auth) RegisterUser

func (a *Auth) RegisterUser(ctx context.Context, register *api.RegisterRequest) (string, error)

we will probably remove this, and init everything with an admin user which can create users instead .... I guess we can keep it for that thouugh doesnt' make much sense to have a register outside anyways

func (*Auth) UserBySession

func (a *Auth) UserBySession(ctx context.Context, sessionID string) (*api.User, error)

type ErrSessionExpired

type ErrSessionExpired struct{}

func (ErrSessionExpired) Error

func (ErrSessionExpired) Error() string

func (ErrSessionExpired) Is

func (ErrSessionExpired) Is(target error) bool

type ErrUserCredentials

type ErrUserCredentials struct{}

func (ErrUserCredentials) Error

func (ErrUserCredentials) Error() string

func (ErrUserCredentials) Is

func (ErrUserCredentials) Is(target error) bool

Jump to

Keyboard shortcuts

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