You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 11, 2024. It is now read-only.
Slim-jwt-auth is "Authentication middleware":
This middleware implements JSON Web Token Authentication.
Authentication should:
parse and validate token if found
add identity of the user to Request (if the token is valid and found)
Authentication SHOULD NOT:
prevent any action
return 401
disallow going to any route
Because it's part of the process which should be handled by AUTHORIZATION middleware.
slim-jwt-auth is authentication middleware , there are several good reasons, why you should not interchange / mix these two terms.
Please do not provide any "authorization" / denial service inside Authentication middleware, it is wrong place to do that and you usually want to sort your middlewares in this way:
...
Authentication (parse and validate identity)
Routing
Authorization
Authentication / Authentication should be split to 2 middlewares and named correctly.
Preventing routes in "authentication" middleware is wrong.
honzis1364, mstrouhal, LukasGirasek, aleswita and fezfez