diff --git a/app/__init__.py b/app/__init__.py
index 5519a7b5fcb35b2a9c1b89af6ea7dc82cb1c6bf1..61c72f58a2d8d02932bac8afda1c27572db53e9f 100644
--- a/app/__init__.py
+++ b/app/__init__.py
@@ -44,7 +44,6 @@ def create_app(config_name):
     Bootstrap(app)  # allowing app to use bootstrap
 
     def get_authorized_user():
-
         user = {
             "username": request.headers.get("REMOTE_USER"),
             "fullname": request.headers.get("Displayname"),
@@ -58,7 +57,6 @@ def create_app(config_name):
         "/", methods=["GET", "POST"]
     )  # initial route to display the reg page
     def index():
-
         valid_eppa = app_vars.valid_eppa
 
         if "uid" not in session:
@@ -71,11 +69,14 @@ def create_app(config_name):
             "redir", app_vars.default_referrer
         )
 
-        if not any(item in session["user"].get("eppa") for item in valid_eppa):
-            return render_template(
-                "account/unauthorized.html",
-                unauthorized_msg=messages.unauthorized_message,
-            )
+        if "eppa" in request.headers:
+            if not any(
+                item in session["user"].get("eppa") for item in valid_eppa
+            ):
+                return render_template(
+                    "account/unauthorized.html",
+                    unauthorized_msg=messages.unauthorized_message,
+                )
 
         if rc_util.check_state(session["user"].get("username")) == "hold":
             return render_template(