Moved the authentication code to the users app.