feat: invalidate token on logout (#6923 close #6792)

This commit is contained in:
itsHenry
2024-08-04 12:32:39 +08:00
committed by GitHub
parent a6bead90d7
commit 81258d3e8a
3 changed files with 33 additions and 0 deletions

View File

@ -181,3 +181,12 @@ func Verify2FA(c *gin.Context) {
common.SuccessResp(c)
}
}
func LogOut(c *gin.Context) {
err := common.InvalidateToken(c.GetHeader("Authorization"))
if err != nil {
common.ErrorResp(c, err, 500)
} else {
common.SuccessResp(c)
}
}