mirror of
https://github.com/Xevion/the-office.git
synced 2025-12-13 18:13:19 -06:00
add vue client folders, rename server files accordingly and update code
This commit is contained in:
17
server/api.py
Normal file
17
server/api.py
Normal file
@@ -0,0 +1,17 @@
|
||||
"""
|
||||
api.py
|
||||
|
||||
Provides a accessible protected backend API. JSON I/O only, CSRF protected.
|
||||
"""
|
||||
import flask_wtf
|
||||
from flask import current_app, jsonify
|
||||
|
||||
|
||||
@current_app.route('/api/csrf/')
|
||||
def csrf():
|
||||
"""
|
||||
Page used for refreshing expired CSRF tokens via AJAX.
|
||||
|
||||
Probably secure: https://medium.com/@iaincollins/csrf-tokens-via-ajax-a885c7305d4a
|
||||
"""
|
||||
return jsonify(flask_wtf.csrf.generate_csrf())
|
||||
Reference in New Issue
Block a user