gobuffalo / buffalo-auth

Buffalo auth plugin helps adding username password authentication to your app
https://gobuffalo.io
MIT License
41 stars 28 forks source link

changed behavior for missing user, in the `SetCurrentUser` middleware #92

Closed sio4 closed 1 year ago

sio4 commented 1 year ago

What is being done in this PR?

In the scaffolded actions/users.go, middleware SetCurrentUser just returned a general error which causes a 404 error. However, it could be better if the middleware generates Unauthorized or just redirects users to the login page. With this change, the middleware redirects the user to the login page.

fixes #30

see also: https://github.com/gobuffalo/buffalo-auth/issues/30#issuecomment-1416676908

What are the main choices made to get to this solution?

List the manual test cases you've covered before sending this PR: