perf: delete user cache after cancel 2FA
This commit is contained in:
@ -26,6 +26,7 @@ type LoginReq struct {
|
||||
OtpCode string `json:"otp_code"`
|
||||
}
|
||||
|
||||
// Login Deprecated
|
||||
func Login(c *gin.Context) {
|
||||
// check count of login
|
||||
ip := c.ClientIP()
|
||||
|
@ -120,3 +120,13 @@ func Cancel2FAById(c *gin.Context) {
|
||||
}
|
||||
common.SuccessResp(c)
|
||||
}
|
||||
|
||||
func DelUserCache(c *gin.Context) {
|
||||
username := c.Query("username")
|
||||
err := op.DelUserCache(username)
|
||||
if err != nil {
|
||||
common.ErrorResp(c, err, 500)
|
||||
return
|
||||
}
|
||||
common.SuccessResp(c)
|
||||
}
|
||||
|
@ -84,6 +84,7 @@ func admin(g *gin.RouterGroup) {
|
||||
user.POST("/update", handles.UpdateUser)
|
||||
user.POST("/cancel_2fa", handles.Cancel2FAById)
|
||||
user.POST("/delete", handles.DeleteUser)
|
||||
user.POST("/del_cache", handles.DelUserCache)
|
||||
|
||||
storage := g.Group("/storage")
|
||||
storage.GET("/list", handles.ListStorages)
|
||||
|
Reference in New Issue
Block a user