Closes #2 and #3

This commit is contained in:
Punnamaraju Vinayaka Tejas 2023-07-12 12:51:39 +05:30
parent f52d98333e
commit de094d4bed
4 changed files with 13 additions and 6 deletions

View file

@ -1,7 +1,7 @@
import functools
from flask import (
Blueprint, flash, g, redirect, render_template, request, session, url_for
Blueprint, flash, g, redirect, render_template, request, session, url_for, current_app, abort
)
from werkzeug.security import check_password_hash, generate_password_hash
@ -11,6 +11,8 @@ bp = Blueprint('auth', __name__, url_prefix='/auth')
@bp.route('/register', methods=('GET', 'POST'))
def register():
if not current_app.config['REGISTER']:
abort(403)
if request.method == 'POST':
username = request.form['username']
password = request.form['password']