mirror of
https://github.com/hazemKrimi/crimson-vault.git
synced 2026-05-01 18:20:27 +00:00
chore: update one of auth middleware errors status code
This commit is contained in:
@@ -36,7 +36,7 @@ func (api *API) AuthSessionMiddleware(next echo.HandlerFunc) echo.HandlerFunc {
|
|||||||
var user types.User
|
var user types.User
|
||||||
|
|
||||||
if err := api.db.GetUserBySessionId(sessionId, &user); err != nil {
|
if err := api.db.GetUserBySessionId(sessionId, &user); err != nil {
|
||||||
return types.Error{Code: http.StatusUnauthorized, Messages: []string{"User not authenticated!"}}
|
return types.Error{Code: http.StatusNotFound, Messages: []string{"User not found!"}}
|
||||||
}
|
}
|
||||||
|
|
||||||
context.Set("id", sess.Values["id"])
|
context.Set("id", sess.Values["id"])
|
||||||
|
|||||||
Reference in New Issue
Block a user