add csrftoken api route
This commit is contained in:
6
app.py
6
app.py
@@ -112,7 +112,6 @@ def get_config():
|
||||
config_out['assets_baseurl'] = ''.join([request.host_url, 'assets']) + '/'
|
||||
|
||||
config_out['_version'] = get_version()
|
||||
config_out['_csrf_token'] = generate_csrf()
|
||||
return config_out
|
||||
|
||||
|
||||
@@ -138,6 +137,11 @@ def route_index():
|
||||
return render_template('index.html', version=version, config=get_config())
|
||||
|
||||
|
||||
@app.route('/api/csrftoken')
|
||||
def route_csrftoken():
|
||||
return jsonify({'status': 'ok', 'token': generate_csrf()})
|
||||
|
||||
|
||||
@app.route('/admin')
|
||||
@admin_required(level=50)
|
||||
def route_admin():
|
||||
|
||||
Reference in New Issue
Block a user