login

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckSignature

func CheckSignature(lastLoginTime int64, logger *zap.SugaredLogger) error

func CreateToken

func CreateToken(claims *Claims) (string, error)

func GetCaptcha

func GetCaptcha(logger *zap.SugaredLogger) (string, string, error)

func LocalLogout

func LocalLogout(userID string, logger *zap.SugaredLogger) (bool, string, error)

func ThirdPartyLoginEnabled

func ThirdPartyLoginEnabled() *enabledStatus

Types

type CheckSignatureRes

type CheckSignatureRes struct {
	Code        int                    `json:"code"`
	Description string                 `json:"description"`
	Extra       map[string]interface{} `json:"extra"`
	Message     string                 `json:"message"`
	Type        string                 `json:"type"`
}

type Claims

type Claims struct {
	Name              string          `json:"name"`
	Email             string          `json:"email"`
	UID               string          `json:"uid"`
	PreferredUsername string          `json:"preferred_username"`
	FederatedClaims   FederatedClaims `json:"federated_claims"`
	jwt.StandardClaims
}

type FederatedClaims

type FederatedClaims struct {
	ConnectorId string `json:"connector_id"`
	UserId      string `json:"user_id"`
}

type LoginArgs

type LoginArgs struct {
	Account       string `json:"account"`
	Password      string `json:"password"`
	CaptchaID     string `json:"captcha_id"`
	CaptchaAnswer string `json:"captcha_answer"`
}

type User

type User struct {
	Uid          string `json:"uid"`
	Token        string `json:"token"`
	Email        string `json:"email"`
	Phone        string `json:"phone"`
	Name         string `json:"name"`
	Account      string `json:"account"`
	IdentityType string `json:"identityType"`
}

func LocalLogin

func LocalLogin(args *LoginArgs, logger *zap.SugaredLogger) (*User, int, error)

Jump to

Keyboard shortcuts

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