auth

package
v0.0.0-...-45c4399 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const JWTExpireInterval = 8

JWTExpireInterval - how long the JWT will last in hours

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthController

type AuthController struct {
	AuthStrategy     union.Union
	JWTSecretsKeeper jwt.SecretsKeeper
	// contains filtered or unexported fields
}

func New

func New(dataStore datastore.DataStore) *AuthController

func (*AuthController) AuthMiddleware

func (a *AuthController) AuthMiddleware(next http.Handler) http.Handler

func (*AuthController) Login

func (a *AuthController) Login(w http.ResponseWriter, r *http.Request)

func (*AuthController) Logout

func (a *AuthController) Logout(w http.ResponseWriter, r *http.Request)

Logout endpoint for user signin

func (*AuthController) RegisterUser

func (a *AuthController) RegisterUser(w http.ResponseWriter, r *http.Request)

Signup register a user to the db

Jump to

Keyboard shortcuts

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