Exception in transformer AshAuthentication.Strategy.Custom.Transformer
Hi there.
I got an exception in transformer AshAuthentication.Strategy.Custom.Transformer when following the Authentication guide . Instead of User I set the resource name to Usuario.
mix.exs
Resource file
The resettable property of the struct strategy is nil at ash_authentication/strategies/password/transformer.ex:77.
I tried to set the property to a function, as shown in the docs (https://hexdocs.pm/ash_authentication/AshAuthentication.Sender.html), but I still get the error.
I hope someone can help me.
Thanks
23 Replies
Are you sure you are getting the same error when adding the sender function like this?
I think I can see why it didn't work without it, but that should change with the
resettable
section being thereWhen I add as suggested, I get the following:
If I add the third argument, the program runs, but when I GET /sign-in, I get the following:
I've just pushed something up
can you try
main
of ash_authentication
?Sure. Thanks. I let you know if it works.
🙇♂️
Zach, the patch solves the original problem related to the resettable property, but the one that pops when I request /sign-in still remains.
👍 taking a look now
Great. Let me know if you need any additional info.
I think I need to talk to @jart, as I think this was a very recent commit that caused the issue
and while I can see how to fix it, I think there is some small but deeper cause
are you on the latest version of both
ash_authentication
and ash_authentication_phoenix
, just to check our bases?Ok. I'm starting my journey with Ash (because of ElixirConf), that's why I'm following the guides. Take your time and I'm ok with that.
These are the versions I'm running on:
"ash": {:hex, :ash, "2.14.20"
"ash_authentication": {:hex, :ash_authentication, "3.11.15"
"ash_authentication_phoenix": {:hex, :ash_authentication_phoenix, "1.8.1"
"ash_phoenix": {:hex, :ash_phoenix, "1.2.17"
"ash_postgres": {:hex, :ash_postgres, "1.3.51"
I've got a similar set up to you on
ash_hq
so I'll see if I can get it reproduced 🙂Allright. I'm here if you need some help with the setup.
yep! Going to latest versions gets me the same error
once I have a reproduction, fixing is usually very easy 😄
I do believe. By the way, what a wonderful piece of technology you guys are doing. Congrats.
found the breaking commit, now to dissect 😄
Okay, so I see what the issue is, but the question is if I should roll forward by fixing ash_authentication_phoenix or undo the changes to ash_authentication...
Probably the former
https://github.com/team-alembic/ash_authentication_phoenix/pull/279 will merge once the build passes
Alright, PR merged. It will auto release a new version.
but you can also point at main if you'd like to try it in the next 10-15 minutes
Thanks a lot, Zach. I'll stop now for lunch. I'll be right back in 30 minutes. Talk to you after that.
Zach, with the #279, I get the following error:
I inspected the strategy struct right before password.ex:111 and got the following:
resettable is nil.
🤔
that line of code isn't right based on what I'm looking at
ash_authentication_phoenix 1.8.1
, 1.8.2
should be out w/ the fix now
can you try that published version?I'll do it now.
Bingo. That worked. I'll keep moving forward and let you know if something brakes. Thanks a lot, Zach. I hope someday I can contribute to this project.
🥳
we'd welcome any contribution you'd like to make, but you've also already contributed 😄
You found and reported a bug, and helped us ensure it was fixed!
I'm getting used to the Ash's code. As soon as I feel that I understand that, I think I can help more. I'll be glad to be part of it. Thanks a lot, Zach.
This is my fault and I am a bad bad person. Thanks @Zach Daniel for cleaning up my mess.