(refactor) move auth functions out of ctrl to factory
Merge pull request #81 from seewes/refactor/login

(refactor) move auth functions out of ctrl to factory