Redirect and resend verification email when pending user attempts to login

This commit is contained in:
Imdad Ahad
2016-09-06 15:44:33 +01:00
parent fb2db09184
commit 998d33e283
2 changed files with 19 additions and 4 deletions

View File

@@ -38,8 +38,8 @@ def sign_in():
user = user_api_client.get_user_by_email_or_none(form.email_address.data)
user = _get_and_verify_user(user, form.password.data)
if user and user.state == 'pending':
flash("You haven't verified your email or mobile number yet.")
return redirect(url_for('main.sign_in'))
flash("You haven't verified your email or mobile number yet. Check your email for a verification link.")
return redirect(url_for('main.resend_email_verification'))
if user and session.get('invited_user'):
invited_user = session.get('invited_user')