Open davejlong opened 7 years ago
The user is coming from Guardian.Plug.current_resource(conn)
. I suspect that its returning a simple struct and not an Ecto.Schema. Add an IO.inspect
to verify.
defmodule KCC.Authentication do
def current_user(conn) do
Guardian.Plug.current_resource(conn)
|> IO.inspect # add this
end
# ...
end
If you have another schema for the user model, then you need to fetch it so the current_user
above returns is.
@smpallen99 my User module is not an Ecto schema. I was able to make it look like it by added __schema__/1
to my module, but I'm wondering if ExAdmin should be requiring the current_user
object to be an Ecto model?
If your up contributing a PR, you could test the current_user for __schema__
here and skip the profile menu item if its not set. Also needs to be done for the active_admin
theme too.
I'm using ExAdmin with Guardian and Ueberauth. Guardian and Ueberauth uses very simple user logic for now:
The authentication config for ExAdmin is also pretty simple:
And I haven't configured ExAdmin to discover my User model:
After logging in, I get the following error:
So my question is what would cause ExAdmin to be trying to discover the schema of
%KCC.User{}
?