Adds persistent authentication and stores auth tokens in the database.