Switch login and logout redirects to functions so you can add more logic