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')
RELEASE_VERSION = 5.1.0
RELEASE_VERSION = 5.0.0
APP = n9e
SERVER_BIN = ${APP}

View File

@ -1,7 +1,16 @@
## Intro
## 简介
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

View File

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