The resource `Example.Accounts.User` does not define an attribute named `:unique_email`
I'm following the getting started guide for Ash Authentication (https://ash-hq.org/docs/guides/ash_authentication_phoenix/latest/tutorials/getting-started-with-ash-authentication-phoenix#reset-password) and I'm getting an error that the :unique_email atom isn't defined. It is defined as an identity though and the only departure I've made from the guide is to set the x.x. dependencies (https://ash-hq.org/docs/guides/ash_authentication_phoenix/latest/tutorials/getting-started-with-ash-authentication-phoenix#application-dependencies) as the latest versions. Could there be some conflict with the different versions?
8 Replies
What does your identity_field configuration say?
identities do
identity :unique_email, [:email]
end
It's copy pasted from the instructions.I'm talking about in the password authentication section
There is an option called
identity_field
Gotcha.
strategies do
password :password do
identity_field(:unique_email)
resettable do
sender(Example.Accounts.User.Senders.SendPasswordResetEmail)
end
end
end
It's copied from the documentation as well.
Sorry, the formatting is a bit wonky, but sender is in the scope of resettable.Yep, the docs are wrong
identity_field :email
is what that should be
Sorry about thatWould you mind opening an issue about this guide being wrong? https://github.com/team-alembic/ash_authentication_phoenix
GitHub
GitHub - team-alembic/ash_authentication_phoenix: Drop-in authentic...
Drop-in authentication support for Phoenix apps using AshAuthentication. - GitHub - team-alembic/ash_authentication_phoenix: Drop-in authentication support for Phoenix apps using AshAuthentication.
Someone will fix it 🙂
Thanks! I will make the ticket 🙂