Fix status banner auth check to use current_scope
phx.gen.auth sets current_scope, not current_user. Use !! to ensure boolean for HEEx template and register_and_log_in_user in tests for proper auth session.
This commit is contained in:
@@ -29,7 +29,7 @@ defmodule FirehoseWeb.BlogController do
|
||||
post: post,
|
||||
base_path: blog.base_path(),
|
||||
visibility: visibility,
|
||||
authenticated: conn.assigns[:current_user] != nil
|
||||
authenticated: !!(conn.assigns[:current_scope] && conn.assigns.current_scope.user)
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user