Skip to content

Commit

Permalink
Fix code sample in API Authentication guide (phoenixframework#5615)
Browse files Browse the repository at this point in the history
  • Loading branch information
vjebelev authored Nov 9, 2023
1 parent 627d452 commit d017a63
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion guides/authentication/api_authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ When we ran `mix phx.gen.auth`, it generated a `MyAppWeb.UserAuth` module with s

```elixir
def fetch_api_user(conn, _opts) do
with ["Bearer " <> token] <- get_req_header("authorization"),
with ["Bearer " <> token] <- get_req_header(conn, "authorization"),
{:ok, user} <- Accounts.fetch_user_by_api_token(token) do
assign(conn, :current_user, user)
else
Expand Down

0 comments on commit d017a63

Please sign in to comment.