Fix profile redirection in login and register