This commit is contained in:
UlricQin 2021-12-01 10:14:35 +08:00
parent 3090e13be7
commit 622d4ac165
3 changed files with 16 additions and 7 deletions

View File

@ -2,7 +2,7 @@
NOW = $(shell date -u '+%Y%m%d%I%M%S') NOW = $(shell date -u '+%Y%m%d%I%M%S')
RELEASE_VERSION = 5.1.0 RELEASE_VERSION = 5.0.0
APP = n9e APP = n9e
SERVER_BIN = ${APP} SERVER_BIN = ${APP}

View File

@ -1,7 +1,16 @@
## Intro ## 简介
Nightingale, Prometheus enterprise edition Nightingale, Prometheus enterprise edition
## 注意
v5正式版还没发布预计12月中旬发布
## 文档
- 国外:[https://n9e.github.io/](https://n9e.github.io/)
- 国内:[https://n9e.gitee.io/](https://n9e.gitee.io/)
- [v4老文档](https://gitee.com/n9e/book/tree/master/content/v4/docs)
## TODO ## TODO

View File

@ -91,7 +91,7 @@ func refreshPost(c *gin.Context) {
// if there is an error, the token must have expired // if there is an error, the token must have expired
if err != nil { if err != nil {
// redirect to login page // redirect to login page
ginx.NewRender(c).Message("refresh token expired") ginx.NewRender(c, http.StatusUnauthorized).Message("refresh token expired")
return return
} }
@ -101,21 +101,21 @@ func refreshPost(c *gin.Context) {
refreshUuid, ok := claims["refresh_uuid"].(string) //convert the interface to string refreshUuid, ok := claims["refresh_uuid"].(string) //convert the interface to string
if !ok { if !ok {
// Theoretically impossible // Theoretically impossible
ginx.NewRender(c).Message("failed to parse refresh_uuid from jwt") ginx.NewRender(c, http.StatusUnauthorized).Message("failed to parse refresh_uuid from jwt")
return return
} }
userIdentity, ok := claims["user_identity"].(string) userIdentity, ok := claims["user_identity"].(string)
if !ok { if !ok {
// Theoretically impossible // Theoretically impossible
ginx.NewRender(c).Message("failed to parse user_identity from jwt") ginx.NewRender(c, http.StatusUnauthorized).Message("failed to parse user_identity from jwt")
return return
} }
// Delete the previous Refresh Token // Delete the previous Refresh Token
err = deleteAuth(c.Request.Context(), refreshUuid) err = deleteAuth(c.Request.Context(), refreshUuid)
if err != nil { if err != nil {
ginx.NewRender(c).Message(InternalServerError) ginx.NewRender(c, http.StatusUnauthorized).Message(InternalServerError)
return return
} }
@ -133,6 +133,6 @@ func refreshPost(c *gin.Context) {
}, nil) }, nil)
} else { } else {
// redirect to login page // redirect to login page
ginx.NewRender(c).Message("refresh token expired") ginx.NewRender(c, http.StatusUnauthorized).Message("refresh token expired")
} }
} }