Ash FrameworkAF
Ash Framework3y ago
42 replies
vedha.ivan

Can't test authentication after configuring Ash AuthenticationPhoenix Tutorial

After following steps on the tutorial for configuring authentication with phoenix, im getting errors on the routes as if the AuthController was not working. When Accessing the main route http://localhost:4000 i get this error:

[info] GET /
[debug] Processing with CaseHolderWeb.PageController.home/2
  Parameters: %{}
  Pipelines: [:browser]
[info] Sent 500 in 220ms
[error] #PID<0.662.0> running Phoenix.Endpoint.SyncCodeReloadPlug (connection #PID<0.660.0>, stream id 1) terminated
Server: localhost:4000 (http)
Request: GET /
** (exit) an exception was raised:
    ** (KeyError) key :current_user not found in: %{conn: %Plug.Conn{adapter: {Plug.Cowboy.Conn, :...}, assigns: %{flash: %{}, layout: false}, body_params: %{}, cookies: %{"CookieConsent" => "{stamp:%27WdyDXvmkdlf9QmCIMoMkq9g4y0EWBHNxudi5fJHBo3A8quW4xYK60g==%27%2Cnecessary:true%2Cpreferences:false%2Cstatistics:false%2Cmarketing:false%2Cver:1%2Cutc:1667260198396%2Cregion:%27us-06%27}", "Pycharm-e2283c24" => "42a5d6d9-0c58-42cd-a3ef-fe39e716c15c", "Webstorm-45dcd7e3" => "e3033df7-0f7e-4297-9158-d5e20a4f64f0",


And if I get on the 'sign-in' page i can only see the header for the page.

I'm new with elixir and phoenix so this might be a problem with me not ocnfiguring something correctly but i've triple checked most things and cant get it working.
Screen_Shot_2023-03-25_at_12.18.49.png
Screen_Shot_2023-03-25_at_12.19.12.png
Was this page helpful?