auth

package
v0.60.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterRouter

func RegisterRouter(r *gin.RouterGroup, handle *jwt.GinJWTMiddleware)

Types

type RegisterRequest

type RegisterRequest struct {
	Username   string `json:"username" form:"username" binding:"required,min=4,max=20" msg:"Username must be between 4 and 20 characters"`
	Password   string `json:"password" form:"password" binding:"required,min=6,max=32" msg:"Password must be between 6 and 32 characters"`
	AuthMethod string `json:"auth_method" form:"auth_method" binding:"required,oneof=telegram email" msg:"Auth method now only supports telegram"`
	Code       string `json:"code" form:"code" binding:"required,min=6,max=6" msg:"Code must be 6 characters"`
	TelegramID int64  `json:"telegram_id" form:"telegram_id" binding:"omitempty" msg:"Invalid telegram ID"`
	Email      string `json:"email" form:"email" binding:"omitempty,email" msg:"Invalid email"`
}

type SendCodeRequest

type SendCodeRequest struct {
	Username   string `json:"username" form:"username" binding:"required,min=4,max=20"`
	AuthMethod string `json:"auth_method" form:"auth_method" binding:"required,oneof=telegram email"`
	Email      string `json:"email" form:"email" binding:"omitempty,email"`
}

Jump to

Keyboard shortcuts

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