From d017a635f66daedb7fb92d887b8b7228db7ec974 Mon Sep 17 00:00:00 2001 From: Vlad Jebelev Date: Wed, 8 Nov 2023 20:10:26 -0500 Subject: [PATCH] Fix code sample in API Authentication guide (#5615) --- guides/authentication/api_authentication.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/authentication/api_authentication.md b/guides/authentication/api_authentication.md index 3d59d439f4..d9de5b06e3 100644 --- a/guides/authentication/api_authentication.md +++ b/guides/authentication/api_authentication.md @@ -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