diff --git a/login/kratos.py b/login/kratos.py
index 37a19947e62bfa8f9d6b5dacb68078028e117125..63ca6cb5268af51767e0ac73ff0b12d812f3cb08 100644
--- a/login/kratos.py
+++ b/login/kratos.py
@@ -242,7 +242,6 @@ class KratosUser():
             # be able to catch the cookies.
             opener = urllib.request.build_opener(RedirectFilter)
             print(f"Opening: {recovery_url}")
-            search = re.match(r'.*\?flow=(.*)', url)
             search = re.match(r'.*(self-service.recovery.flow.*)$', recovery_url)
             if search:
                 recovery_url = api_url + "/" . search.group(1)