authenticator

package
v0.0.0-...-b5fa026 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2024 License: Apache-2.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 Authenticator

type Authenticator struct {
	*oidc.Provider
	oauth2.Config

	Store *session.Store
}

Authenticator is used to authenticate our users.

func NewAuthenticator

func NewAuthenticator(store *session.Store) (*Authenticator, error)

func (*Authenticator) AuthMiddleware

func (a *Authenticator) AuthMiddleware() fiber.Handler

AuthMiddleware is a middleware that checks if the user is authenticated and sets the user ID in the context

func (*Authenticator) AuthRequired

func (a *Authenticator) AuthRequired(c *fiber.Ctx) error

AuthRequired is a middleware that checks if the user is authenticated

func (*Authenticator) Callback

func (a *Authenticator) Callback(c *fiber.Ctx) error

Callback handles the callback from Auth0

func (*Authenticator) GetOrCreateUser

func (a *Authenticator) GetOrCreateUser(profile map[string]interface{}) (*models.User, error)

func (*Authenticator) GetUser

func (a *Authenticator) GetUser(c *fiber.Ctx) error

GetUser returns the user data

func (*Authenticator) Login

func (a *Authenticator) Login(c *fiber.Ctx) error

Login initiates the authentication process

func (*Authenticator) Logout

func (a *Authenticator) Logout(c *fiber.Ctx) error

Logout logs the user out

Jump to

Keyboard shortcuts

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