Ash FrameworkAF
Ash Framework6mo ago
7 replies
aidalgol

Multiple confirmation strategies with interaction

It appears to be impossible to use require_interaction? true with more than one confirmation strategy, because using the confirm_route macro more than once produces a compile-time error.
confirm_route MyApp.Accounts.User, :confirm_new_user, auth_routes_prefix: "/auth"
confirm_route MyApp.Accounts.User, :confirm_email_change, auth_routes_prefix: "/auth"

== Compilation error in file lib/my_app_web/router.ex ==
** (RuntimeError) attempting to redefine live_session :auth_confirm.
live_session routes must be declared in a single named block.

Am I missing something, or is this a bug?
Solution
but yes, the two routes need to be disambiguated, via the as option
Was this page helpful?