Documentation ¶
Index ¶
- type Authenticator
- func (a *Authenticator) AuthMiddleware() fiber.Handler
- func (a *Authenticator) AuthRequired(c *fiber.Ctx) error
- func (a *Authenticator) Callback(c *fiber.Ctx) error
- func (a *Authenticator) GetOrCreateUser(profile map[string]interface{}) (*models.User, error)
- func (a *Authenticator) GetUser(c *fiber.Ctx) error
- func (a *Authenticator) Login(c *fiber.Ctx) error
- func (a *Authenticator) Logout(c *fiber.Ctx) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authenticator ¶
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
Click to show internal directories.
Click to hide internal directories.