x
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m55s

This commit is contained in:
shanshanzhong 2026-03-11 01:13:56 -07:00
parent d78ec194af
commit 76a1500d3c
2 changed files with 18 additions and 0 deletions

View File

@ -50,6 +50,17 @@ type (
LoginType string `header:"Login-Type"`
CfToken string `json:"cf_token,optional"`
}
// Email login request
EmailLoginRequest {
Identifier string `json:"identifier"`
Email string `json:"email" validate:"required"`
Code string `json:"code" validate:"required"`
Invite string `json:"invite,optional"`
IP string `header:"X-Original-Forwarded-For"`
UserAgent string `header:"User-Agent"`
LoginType string `header:"Login-Type"`
CfToken string `json:"cf_token,optional"`
}
LoginResponse {
Token string `json:"token"`
}
@ -142,6 +153,10 @@ service ppanel {
@handler CheckUser
get /check (CheckUserRequest) returns (CheckUserResponse)
@doc "Email Login"
@handler EmailLogin
post /login/email (EmailLoginRequest) returns (LoginResponse)
@doc "User register"
@handler UserRegister
post /register (UserRegisterRequest) returns (LoginResponse)

View File

@ -671,6 +671,9 @@ func RegisterHandlers(router *gin.Engine, serverCtx *svc.ServiceContext) {
// Device Login
authGroupRouter.POST("/login/device", auth.DeviceLoginHandler(serverCtx))
// Email Login
authGroupRouter.POST("/login/email", auth.EmailLoginHandler(serverCtx))
// User Telephone login
authGroupRouter.POST("/login/telephone", auth.TelephoneLoginHandler(serverCtx))