I'm building an application in rails that uses devise for authentication. When you log in to the application it redirects you to home page. But if you then press back you are presented with the login form again. If you then log in to a new user account you again get redirected to the home page but are still logged in as the original user.
Instead I want an error to pop up on the second login saying that we were unable to log the user in to the second account because they were already logged in.
From my research it looks like I should be able to do this with a custom controller, is there an easier way?