feat(auth): 在登录响应中添加会话限制信息
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m32s
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m32s
在LoginResponse结构体中新增Limit字段,用于返回用户最大会话数限制 修复userLoginLogic.go和telephoneLoginLogic.go中的缩进问题
This commit is contained in:
parent
7e32c571ab
commit
236fa6c4e6
@ -166,6 +166,7 @@ func (l *DeviceLoginLogic) DeviceLogin(req *types.DeviceLoginRequest) (resp *typ
|
|||||||
loginStatus = true
|
loginStatus = true
|
||||||
return &types.LoginResponse{
|
return &types.LoginResponse{
|
||||||
Token: token,
|
Token: token,
|
||||||
|
Limit: l.svcCtx.Config.JwtAuth.MaxSessionsPerUser,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -79,7 +79,10 @@ func (l *OAuthLoginGetTokenLogic) OAuthLoginGetToken(req *types.OAuthLoginGetTok
|
|||||||
}
|
}
|
||||||
|
|
||||||
loginStatus = true
|
loginStatus = true
|
||||||
return &types.LoginResponse{Token: token}, nil
|
return &types.LoginResponse{
|
||||||
|
Token: token,
|
||||||
|
Limit: l.svcCtx.Config.JwtAuth.MaxSessionsPerUser,
|
||||||
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (l *OAuthLoginGetTokenLogic) google(req *types.OAuthLoginGetTokenRequest, requestID, ip, userAgent string) (*user.User, error) {
|
func (l *OAuthLoginGetTokenLogic) google(req *types.OAuthLoginGetTokenRequest, requestID, ip, userAgent string) (*user.User, error) {
|
||||||
|
|||||||
@ -166,5 +166,6 @@ func (l *TelephoneLoginLogic) TelephoneLogin(req *types.TelephoneLoginRequest, r
|
|||||||
loginStatus = true
|
loginStatus = true
|
||||||
return &types.LoginResponse{
|
return &types.LoginResponse{
|
||||||
Token: token,
|
Token: token,
|
||||||
|
Limit: l.svcCtx.Config.JwtAuth.MaxSessionsPerUser,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@ -121,5 +121,6 @@ func (l *UserLoginLogic) UserLogin(req *types.UserLoginRequest) (resp *types.Log
|
|||||||
loginStatus = true
|
loginStatus = true
|
||||||
return &types.LoginResponse{
|
return &types.LoginResponse{
|
||||||
Token: token,
|
Token: token,
|
||||||
|
Limit: l.svcCtx.Config.JwtAuth.MaxSessionsPerUser,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1219,6 +1219,7 @@ type LoginLog struct {
|
|||||||
|
|
||||||
type LoginResponse struct {
|
type LoginResponse struct {
|
||||||
Token string `json:"token"`
|
Token string `json:"token"`
|
||||||
|
Limit int64 `json:"limit"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type MessageLog struct {
|
type MessageLog struct {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user