auth

package
v0.0.0-...-d6d2609 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2025 License: BSD-3-Clause Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthMiddleware

func AuthMiddleware(fetch gobwebs.UserFetch) echo.MiddlewareFunc

AuthMiddleware checks for an authenticated user, if present, sets it on the context

func AuthRequired

func AuthRequired() echo.MiddlewareFunc

AuthRequired will require an authenticated user to continue. This requires that the AuthMiddleware be called BEFORE AuthRequired

func Context

func Context(ctx context.Context, user gobwebs.User) context.Context

Context adds user object to context for immediate use

func ForContext

func ForContext(ctx context.Context) gobwebs.User

ForContext pulls user value for context

func UserLogin

func UserLogin(c echo.Context, uid uint) error

UserLogin logs a user in by setting the session value

func UserLogout

func UserLogout(c echo.Context) error

UserLogout removes a user from the session, thus logging them out

Types

This section is empty.

Jump to

Keyboard shortcuts

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