AshAuthentication identity :token_context

With the latest release of AshAuthention, I'm getting a DSL error.
** (EXIT from #PID<0.96.0>) an exception was raised:
** (Spark.Error.DslError) [MyApp.Users.UserToken]
identities -> token_context:
All identity keys must be attributes. Got: :context
** (EXIT from #PID<0.96.0>) an exception was raised:
** (Spark.Error.DslError) [MyApp.Users.UserToken]
identities -> token_context:
All identity keys must be attributes. Got: :context
identities do
identity :token_context, [:context, :token]
end
identities do
identity :token_context, [:context, :token]
end
My git blame says I added this when migrating to Ash, but I don't remember why or see it referenced in any of the guides. Any idea what I was trying to do here?
4 Replies
ZachDaniel
ZachDaniel•2y ago
🤔 if you remove that identity, do you have a :context attribute on the resource? i.e Ash.Resource.Info.attribute(MyApp.Users.UserToken, :context)?
Robert Graff
Robert GraffOP•2y ago
I don't have a context attribute in my UserToken. Before migrating to Ash, I was using the phoenix auth. I think this is lint from that.
ZachDaniel
ZachDaniel•2y ago
I might just remove that identity then 🙂 We updated ash to raise an error on invalid identities
Robert Graff
Robert GraffOP•2y ago
That's what I thought

Did you find this page helpful?