auth

package
v0.0.0-...-d369a32 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TokenHeader = "Token"
)

cookie 中 session id 的 key

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	EnableProxy   bool
	SecretKey     string
	LoginRedirect string
	// contains filtered or unexported fields
}

Auth 代表登录认证模块

func New

func New(accounts *account.Account, secretKey string, redirect string) Auth

New 创建登录认证引擎

func (Auth) CheckLogin

func (auth Auth) CheckLogin(ctx *fasthttp.RequestCtx) (account.User, error)

CheckLogin 校验请求者的登录信息

func (Auth) Login

func (auth Auth) Login(ctx *fasthttp.RequestCtx) (string, error)

Login 处理登录逻辑

Jump to

Keyboard shortcuts

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