This project is a port from https://github.com/fnakstad/angular-client-side-auth