From 9aefbb7d20bdf5fd9d6364fc2adab28b149ae614 Mon Sep 17 00:00:00 2001 From: aaronleetw Date: Fri, 1 Oct 2021 15:08:10 +0000 Subject: [PATCH] Show log --- app.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index f58bd50..d0efc93 100644 --- a/app.py +++ b/app.py @@ -52,11 +52,13 @@ def index(): return render_template('login.html') return redirect('/manage') elif request.method == 'POST': + email = request.form['username'] + "@group-attendance.fhjh.tp.edu.tw" if check_login_status(): try: if (verify_recaptcha(request.form['g-recaptcha-response'])): user = auth.sign_in_with_email_and_password( - request.form['username'] + "@group-attendance.fhjh.tp.edu.tw", request.form['password']) + email, request.form['password']) + print("Login SUCC:", email, flush=True) session['is_logged_in'] = True session['email'] = user['email'] session['uid'] = user['localId'] @@ -65,13 +67,15 @@ def index(): session['loginTime'] = datetime.now(tz) return redirect('/manage') else: + print("ReC Error:", email, flush=True) flash( 'reCAPTCHA 錯誤,請稍後再試一次
reCAPTCHA Failed. Please try again later.') return redirect('/') except Exception as e: - flash( + print("Error:", email, str(e), flush=True) + flash( '帳號或密碼錯誤,請重新輸入
Incorrect username or password') - return redirect('/') + return redirect('/') else: return redirect('/manage')