chore: fix user message

This commit is contained in:
Steven
2023-11-12 15:49:00 +08:00
parent 916423cc89
commit af9655eeaf
2 changed files with 7 additions and 2 deletions

View File

@@ -63,7 +63,7 @@ func JWTMiddleware(s *APIV1Service, next echo.HandlerFunc, secret string) echo.H
accessToken := findAccessToken(c)
if accessToken == "" {
// When the request is not authenticated, we allow the user to access the shortcut endpoints for those public shortcuts.
if util.HasPrefixes(path, "/s/") && method == http.MethodGet {
if util.HasPrefixes(path, "/s/", "/api/v1/user/") && method == http.MethodGet {
return next(c)
}
return echo.NewHTTPError(http.StatusUnauthorized, "Missing access token")