auth

package
v1.10.8 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: MIT Imports: 5 Imported by: 12

Documentation

Index

Constants

View Source
const (
	OrgKey      = "org"
	DeptKey     = "dept"
	ClientKey   = "clientType"
	UidKey      = "uid"
	UserInfoKey = "ui"
)

Variables

View Source
var (
	ErrNotAllowed = errors.New("401 not allowed")
)
View Source
var TokenStorage token.Storage

Functions

func GetClientType

func GetClientType(ctx iris.Context) (ct string)

func GetDept

func GetDept(ctx iris.Context) (dept string)

func GetOrg

func GetOrg(ctx iris.Context) (org string)

func GetUid

func GetUid(ctx iris.Context) (uid string)

func GetUserInfo

func GetUserInfo(ctx iris.Context) (uid token.JwtPayload, err error)

func JwtAuth

func JwtAuth(ctx iris.Context)

JwtAuth 验证器, EnableTokenValidator后可用

Types

type Response

type Response struct {
	Code    interface{} `json:"code,omitempty"`
	Message string      `json:"message,omitempty"`
}

Jump to

Keyboard shortcuts

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