-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
27 lines (18 loc) · 719 Bytes
/
app.py
File metadata and controls
27 lines (18 loc) · 719 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from flask import Flask, render_template, request, session
import authentication
app = Flask(__name__)
# Set the secret key to some random bytes. Keep this really secret!
app.secret_key = b'_5#y2L"F4Q8z\n\xec]/'
@app.route('/')
@authentication.authenticate
def hello_world():
# Return this to the user who visited this page. The browser will render it.
return f'Hello {authentication.get_actual_user_data()}!'
@app.route('/login', methods=['GET', 'POST'])
def login():
if request.method == 'POST':
return authentication.verify_password(request.form['email'], request.form.get('password'), app)
else:
return render_template('login.html')
if __name__ == '__main__':
app.run()