authentication - How to handle additional login after pressing back with Devise in Rails -
I am creating an application in Rail, which plans for authentication. When you sign into the app, it redirects you to the home page. But if you press back again, then you are presented again with the entrance form. If you then log in to a new user account, you are redirected to the home page again, but still logged in as the original user.
Instead, I need an error to pop up on the second login which is saying that we were unable to log in to another account because they were already logged in.
From my research it seems that I should be able to do this with a custom controller, is there any easy way?
In your controller, determine whether the login page already has a signed user. If there is, redirect it to where they should go after login. Viewing this login page prevents any login usage.
Comments
Post a Comment