I’m trying to redirect the user if their account hasn’t been confirmed. So this involves two parts of the code:
- Redirect the user after they first create the account
- Redirect them if they try to sign in before confirming the account
I need help with the second.
The first I was able to do by putting in after_inactive_sign_up_path_for(resource) in my custom RegistrationsController. I’ve tried to do the same for a SessionsController, but it didn’t work. What do I need to over write in order to properly redirect the user if they haven’t confirmed the account yet?
You may have to create a custom warden strategy and check if the account needs confirmation. Something of this sorts:
This assumes the username and password are passed in the request as params. You can look at the database_authenticable strategy for an example of how Devise deals with sign-in authentication by default.