Don't automatically login on first run.

This commit is contained in:
Disassembler 2018-11-02 05:36:08 +01:00
parent 7eaab3d6e2
commit 1fdf65c850
No known key found for this signature in database
GPG Key ID: 524BD33A0EE29499
2 changed files with 1 additions and 10 deletions

View File

@ -7,7 +7,6 @@
"host": {
"adminpwd": "${ADMINPWD}",
"domain": "spotter.vm",
"firstrun": true,
"port": "443"
},
"packages": {},

View File

@ -122,15 +122,7 @@ class WSGIApp(object):
return redirect('/')
def portal_view(self, request):
# Default portal view. If this is the first run, perform first-run setup.
if self.conf['host']['firstrun']:
# Set user as admin
request.session['admin'] = True
# Disable and save first-run flag
self.conf['host']['firstrun'] = False
self.conf.save()
# Redirect to host setup view
return redirect('/setup-host')
# Default portal view.
host = tools.compile_url(self.conf['host']['domain'], self.conf['host']['port'])[8:]
if request.session['admin']:
return self.render_template('portal-admin.html', request, host=host)