This repository has been archived on 2020-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
quay/endpoints/web.py

30 lines
No EOL
712 B
Python

from flask import abort, send_file, redirect, request
from data import model
from app import app
@app.route('/', methods=['GET'])
def index():
return send_file('templates/index.html')
@app.route('/signin', methods=['POST'])
def signin():
username = request.form['username']
password = request.form['password']
#TODO Allow email login
verified = model.verify_user(username, password)
if verified:
logger.debug('Successfully signed in as: %s' % username)
login_user(_LoginWrappedDBUser(verified))
return redirect(request.args.get('next') or url_for('index'))
abort(403)
@app.route('/signin', methods=['GET'])
def render_signin_page():
return send_file('templates/signin.html')