perf(auth): 降低会话校验请求与重复查库
This commit is contained in:
@@ -217,6 +217,11 @@ func (h *Handler) Logout(c *gin.Context) {
|
||||
response.OK(c, gin.H{"logged_out": true})
|
||||
}
|
||||
|
||||
// Session 返回当前 access token 仍有效。数据库校验由 requireAuth 完成,这里不重复查询。
|
||||
func (h *Handler) Session(c *gin.Context) {
|
||||
response.OK(c, gin.H{"active": true})
|
||||
}
|
||||
|
||||
func (h *Handler) PasswordLogin(c *gin.Context) {
|
||||
var req PasswordLoginRequest
|
||||
if err := c.ShouldBindJSON(&req); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user