auth

package
v0.0.0-...-5327f33 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUserGroup

func GetUserGroup(c echo.Context) string

get user group

func IsAdmin

func IsAdmin(next echo.HandlerFunc) echo.HandlerFunc

func IsRequestAdmin

func IsRequestAdmin(c echo.Context) (string, bool)

check if it's admin

func MiddlewareRes

func MiddlewareRes(next echo.HandlerFunc) echo.HandlerFunc

func Token

func Token(user model.TableUser) (string, error)

Types

type JwtUserClaim

type JwtUserClaim struct {
	UserName        string `json:"username"`
	UserAdmin       bool   `json:"useradmin"`
	UserGroup       string `json:"usergroup"`
	ExternalAuth    bool   `json:"externalauth"`
	ExternalProfile string `json:"externaltype"`
	DisplayName     string `json:"displayname"`
	Avatar          string `json:"avatar"`
	jwt.StandardClaims
}

jwt token claims which contains info regarding user

func GetUserProfile

func GetUserProfile(c echo.Context) (*JwtUserClaim, error)

get user group

Jump to

Keyboard shortcuts

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