airblade / quo_vadis

Multifactor authentication for Rails (7 and 6).
MIT License
33 stars 4 forks source link

Use known-name routes because redirection targets can conflict with actual names #36

Open airblade opened 6 months ago

airblade commented 6 months ago

Currently the way to configure where QuoVadis redirects the user after, e.g., logging in is to specify a route with the name :after_login:

get '/dashboard', to: 'dashboards#show', as: :after_login

But that means if you want to give the route its "own" name, :dashboard, you need to duplicate the routes:

get '/dashboard', to: 'dashboards#show', as: :dashboard
get '/dashboard', to: 'dashboards#show', as: :after_login

This is a little inelegant.