Redirect correctly after signup or login