Reimplemented login mechanism with AngularJS.