Move to services/auth_service.js or something like that.