mirror of
https://github.com/jiojciojsioe3/a3cjroijsiojiorj.git
synced 2024-11-15 07:21:50 +08:00
add csrftoken api route
This commit is contained in:
parent
96b1ba4b04
commit
841e9d37d1
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():
|
||||
|
@ -10,7 +10,11 @@
|
||||
{% for song in songs %}
|
||||
<a href="/admin/songs/{{ song.id }}" class="song-link">
|
||||
<div class="song">
|
||||
<p>{{ song.title }}</p>
|
||||
{% if song.title_lang.en %}
|
||||
<p>{{ song.title_lang.en }} <small>({{ song.title }})</small></p>
|
||||
{% else %}
|
||||
<p>{{ song.title }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
|
Loading…
Reference in New Issue
Block a user