Fix the login redirection from Topic page

Currently the unauthenticated users on a Topic page are not redirected back to the Topic page after successful login. This pull request fixes that.