initial auth and template setup