Merge branch 'main' of https://gitlab.com/sagev9000/undercover into main
This commit is contained in:
commit
00472d39a3
|
@ -63,13 +63,22 @@ class CLForm(Form):
|
|||
)
|
||||
|
||||
|
||||
@writing_blueprint.route('/login', methods=['POST'])
|
||||
@writing_blueprint.route('/login', methods=['POST', 'GET'])
|
||||
def login_post():
|
||||
username = request.form['username']
|
||||
if db.login(username, request.form['password']):
|
||||
session['username'] = username
|
||||
return redirect('/')
|
||||
return make_response("", 401)
|
||||
if request.method == 'POST':
|
||||
username = request.form['username']
|
||||
if db.login(username, request.form['password']):
|
||||
session['username'] = username
|
||||
return redirect('/')
|
||||
return make_response("", 401)
|
||||
|
||||
return '''
|
||||
<form method="post">
|
||||
<p><input type=text name=username></p>
|
||||
<p><input type=password name=password></p>
|
||||
<p><input type=submit value=Login></p>
|
||||
</form>
|
||||
'''
|
||||
|
||||
|
||||
@writing_blueprint.route('/', methods=['GET'])
|
||||
|
|
Loading…
Reference in New Issue