Skip to content
This repository was archived by the owner on Sep 27, 2022. It is now read-only.
This repository was archived by the owner on Sep 27, 2022. It is now read-only.

Redundant and confusing code in UserController#current_user #24

@mtarnovan

Description

@mtarnovan

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions