Fix ab870a54b9

Fixes critical errors and I added redirects after succesful log-in and log-out.