Commit 36da72df authored by Roman Shishkin's avatar Roman Shishkin

Пробрасывание key в эндпоинты

parent 0bc8966f
......@@ -22,29 +22,29 @@ def init(app):
def submit(id, key):
if check_user(app.config['APP_ID'], id, app.config['APP_SECRET'], key) is False:
return render_template('error.html')
return render_template('submit.html', id=id)
return render_template('submit.html', id=id, key=key)
@app.route('/admin/<int:id>/<string:key>')
def admin(id, key):
if check_user(app.config['APP_ID'], id, app.config['APP_SECRET'], key) is False:
return render_template('error.html')
return render_template('admin.html', id=id)
return render_template('admin.html', id=id, key=key)
@app.route('/editor/<int:id>/<string:key>')
def editor(id, key):
if check_user(app.config['APP_ID'], id, app.config['APP_SECRET'], key) is False:
return render_template('error.html')
return render_template('editor.html', id=id)
return render_template('editor.html', id=id, key=key)
if app.config['DEBUG']:
@app.route('/submit')
def submit_dev():
return render_template('submit.html', id=1)
return render_template('submit.html', id=1, key='d666f7eddb8aa15092c48c64bff6c7d4')
@app.route('/admin')
def admin_dev():
return render_template('admin.html', id=1)
return render_template('admin.html', id=1, key='d666f7eddb8aa15092c48c64bff6c7d4')
@app.route('/editor')
def editor_dev():
return render_template('editor.html', id=1)
return render_template('editor.html', id=1, key='d666f7eddb8aa15092c48c64bff6c7d4')
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment