From e3cb004fd4d6bee055108dda3b4fed0a9105bc54 Mon Sep 17 00:00:00 2001
From: Mart van Santen <mart@greenhost.nl>
Date: Mon, 6 Dec 2021 08:03:39 +0100
Subject: [PATCH] Small fix

---
 login/app.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/login/app.py b/login/app.py
index ac2136e..21b5ad5 100644
--- a/login/app.py
+++ b/login/app.py
@@ -16,6 +16,7 @@ import click
 # Flask
 from flask import abort, Flask, redirect, request, render_template
 from flask_sqlalchemy import SQLAlchemy
+from flask_migrate import Migrate
 # False positive: pylint: disable=ungrouped-imports
 from flask.cli import AppGroup
 
@@ -481,7 +482,7 @@ def consent():
     username = consent_request.subject
 
     # Get the related user object
-    user = KratosUser.find_by_email(KRATOS_ADMIN, email)
+    user = KratosUser.find_by_email(KRATOS_ADMIN, username)
     if not user:
         app.logger.error(f"User not found in database: {username}")
         abort(401, description="User not found. Please try again.")
-- 
GitLab