fix some endpoints
This commit is contained in:
parent
7aee99ac42
commit
6f1b94c040
10 changed files with 47 additions and 41 deletions
|
@ -61,9 +61,11 @@ func (app *App) APIAuth(scope database.TokenScope, anonAccess bool) func(next ht
|
|||
render.JSON(w, r, api.Error{
|
||||
Code: api.ErrInvalidToken,
|
||||
Message: api.ErrCodeMessage(api.ErrInvalidToken),
|
||||
Details: "No token supplied",
|
||||
})
|
||||
return
|
||||
}
|
||||
header = cookie.Value
|
||||
}
|
||||
|
||||
token, err := app.ParseToken(r.Context(), header)
|
||||
|
@ -72,6 +74,7 @@ func (app *App) APIAuth(scope database.TokenScope, anonAccess bool) func(next ht
|
|||
render.JSON(w, r, api.Error{
|
||||
Code: api.ErrInvalidToken,
|
||||
Message: api.ErrCodeMessage(api.ErrInvalidToken),
|
||||
Details: "Could not parse token",
|
||||
})
|
||||
return
|
||||
}
|
||||
|
@ -81,6 +84,7 @@ func (app *App) APIAuth(scope database.TokenScope, anonAccess bool) func(next ht
|
|||
render.JSON(w, r, api.Error{
|
||||
Code: api.ErrInvalidToken,
|
||||
Message: api.ErrCodeMessage(api.ErrInvalidToken),
|
||||
Details: "Token is expired",
|
||||
})
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue