mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-23 16:54:25 +01:00
setup now automatically logs in
This commit is contained in:
@@ -83,10 +83,17 @@ def setup():
|
|||||||
db.session.add(page)
|
db.session.add(page)
|
||||||
db.session.add(admin)
|
db.session.add(admin)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
|
session['username'] = admin.name
|
||||||
|
session['id'] = admin.id
|
||||||
|
session['admin'] = admin.admin
|
||||||
|
session['nonce'] = sha512(os.urandom(10))
|
||||||
|
|
||||||
db.session.close()
|
db.session.close()
|
||||||
app.setup = False
|
app.setup = False
|
||||||
with app.app_context():
|
with app.app_context():
|
||||||
cache.clear()
|
cache.clear()
|
||||||
|
|
||||||
return redirect(url_for('views.static_html'))
|
return redirect(url_for('views.static_html'))
|
||||||
return render_template('setup.html', nonce=session.get('nonce'))
|
return render_template('setup.html', nonce=session.get('nonce'))
|
||||||
return redirect(url_for('views.static_html'))
|
return redirect(url_for('views.static_html'))
|
||||||
|
|||||||
Reference in New Issue
Block a user