feat: fix showing wrong error message: "Please sign in first" (#1245)

This commit is contained in:
Yaodong Yu
2022-10-27 23:50:45 +08:00
committed by GitHub
parent 971e53dfd8
commit 80bf29d79a
17 changed files with 9 additions and 11 deletions

View File

@ -83,7 +83,7 @@ func (c *ApiController) SetTokenErrorHttpStatus() {
func (c *ApiController) RequireSignedIn() (string, bool) {
userId := c.GetSessionUsername()
if userId == "" {
c.ResponseError(c.T("LoginErr.SignInFirst"))
c.ResponseError(c.T("LoginErr.LoginFirst"), "Please login first")
return "", false
}
return userId, true