mirror of https://github.com/JohnHammond/CTFd.git
setup now automatically logs in
parent
967129a009
commit
15171f1140
|
@ -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'))
|
||||||
|
|
Loading…
Reference in New Issue