I can have two types of users sign up on my app, "girls" and "boys". If a girl signs up I want to redirect to "/girls" and if a boy signs up I want to redirect to "/boys".
Is it possible to do custom redirection with Devise?
The closest docs I found are here: https://github.com/plataformatec/devise/wiki/How-To:-redirect-to-a-specific-page-on-successful-sign-in. The problem is I can't do any check to switch the redirect route.
Options I've considered:
- Pass an additional URL param when user clicks "sign-up". like
?is_girl=1
. - After they click
sign-up
, when determining the redirect route, I could look at the users model and see if they're a girl or boy. Then redirect accordingly.