I'm getting a `:type not found in :nil` error when trying to roll my own confirm user page

Originating from this call:
form =
Offen.Accounts.User
|> AshPhoenix.Form.for_action(:confirm_new_user, as: "confirm_new_user")
form =
Offen.Accounts.User
|> AshPhoenix.Form.for_action(:confirm_new_user, as: "confirm_new_user")
It seems like it's not the right action name, even though I have:
confirmation :confirm_new_user do
monitor_fields [:email]
confirm_on_create? true
confirm_on_update? false
require_interaction? true
confirmed_at_field :confirmed_at
auto_confirm_actions [:sign_in_with_magic_link, :reset_password_with_token]
sender Offen.Accounts.User.Senders.SendNewUserConfirmationEmail
end
confirmation :confirm_new_user do
monitor_fields [:email]
confirm_on_create? true
confirm_on_update? false
require_interaction? true
confirmed_at_field :confirmed_at
auto_confirm_actions [:sign_in_with_magic_link, :reset_password_with_token]
sender Offen.Accounts.User.Senders.SendNewUserConfirmationEmail
end
7 Replies
Quentin
QuentinOP4mo ago
I also tried a regular form with a POST action on /auth/user/confirm_new_user with the token, but I'm getting a crsf token missing error.
Rebecca Le
Rebecca Le4mo ago
confirmation isn't done by an action in your resource - its done by something internal to ash_authentication
Quentin
QuentinOP4mo ago
ah okay, so I just need to POST to the confirm endpoint, then. But why am I getting a CSRF token error when I try this method ?
Rebecca Le
Rebecca Le4mo ago
it's not a POST request to the endpoint well it is, but it should be a GET then a form submission to POST
Quentin
QuentinOP4mo ago
with "token" = token as form data right ? am I missing the docs about this ? ok, the param name with actually confirm instead of token still, I wonder how do I get docs about this
ZachDaniel
ZachDaniel4mo ago
The routes are described in mix phx.routes which might help, but otherwise it sounds like this is docs missing from ash authentication magic link guides. Could you open an issue?
Quentin
QuentinOP4mo ago
@ZachDaniel Sure Zach! mix phx.routes is exacly what I was looking for actually, very cool

Did you find this page helpful?