diff options
Diffstat (limited to 'gn_auth/auth/authorisation/users')
-rw-r--r-- | gn_auth/auth/authorisation/users/views.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gn_auth/auth/authorisation/users/views.py b/gn_auth/auth/authorisation/users/views.py index cc70d76..8135ed3 100644 --- a/gn_auth/auth/authorisation/users/views.py +++ b/gn_auth/auth/authorisation/users/views.py @@ -22,6 +22,8 @@ from flask import ( from gn_auth.smtp import send_message, build_email_message +from gn_auth.auth.requests import request_json + from gn_auth.auth.db import sqlite3 as db from gn_auth.auth.db.sqlite3 import with_db_connection @@ -166,7 +168,7 @@ def register_user() -> Response: __assert_not_logged_in__(conn) try: - form = request.json + form = request_json() email = validate_email(form.get("email", "").strip(), check_deliverability=True) password = validate_password( @@ -204,7 +206,7 @@ def delete_verification_code(cursor, code: str): @users.route("/verify", methods=["GET", "POST"]) def verify_user(): """Verify users are not bots.""" - form = request.json + form = request_json() loginuri = redirect(url_for( "oauth2.auth.authorise", response_type=(request.args.get("response_type") @@ -308,7 +310,7 @@ def list_all_users() -> Response: @users.route("/handle-unverified", methods=["POST"]) def handle_unverified(): """Handle case where user tries to login but is unverified""" - form = request.json + form = request_json() # TODO: Maybe have a GN2_URI setting here? # or pass the client_id here? return render_template( @@ -321,7 +323,7 @@ def handle_unverified(): @users.route("/send-verification", methods=["POST"]) def send_verification_code(): """Send verification code email.""" - form = request.json + form = request_json() with (db.connection(current_app.config["AUTH_DB"]) as conn, db.cursor(conn) as cursor): user = user_by_email(conn, form["user_email"]) |