Open mtarnovan opened 6 years ago
I believe https://github.com/gothinkster/elixir-phoenix-realworld-example-app/blob/master/lib/real_world_web/controllers/user_controller.ex#L29-L35 is redundant and confusing. There is no need to check user for nil and render 404.json, as Guardian already has an error handler which will be invoked when trying to access UserController#current_user without being authenticated.
user
UserController#current_user
@mtarnovan I absolutely agree. Can you send a PR with the suggestion? I'll merge it in ❤️
(sorry for the delay by the way, my first baby boy was born in August I have been away for a while)
I believe https://github.com/gothinkster/elixir-phoenix-realworld-example-app/blob/master/lib/real_world_web/controllers/user_controller.ex#L29-L35 is redundant and confusing. There is no need to check
user
for nil and render 404.json, as Guardian already has an error handler which will be invoked when trying to accessUserController#current_user
without being authenticated.