aboutsummaryrefslogtreecommitdiff
path: root/gn2
diff options
context:
space:
mode:
Diffstat (limited to 'gn2')
-rw-r--r--gn2/wqflask/__init__.py2
-rw-r--r--gn2/wqflask/collect.py2
-rw-r--r--gn2/wqflask/decorators.py2
-rw-r--r--gn2/wqflask/oauth2/checks.py6
-rw-r--r--gn2/wqflask/oauth2/collections.py2
-rw-r--r--gn2/wqflask/oauth2/toplevel.py4
-rw-r--r--gn2/wqflask/oauth2/ui.py2
-rw-r--r--gn2/wqflask/oauth2/users.py5
-rw-r--r--gn2/wqflask/views.py2
9 files changed, 15 insertions, 12 deletions
diff --git a/gn2/wqflask/__init__.py b/gn2/wqflask/__init__.py
index 325a1cef..1f69c085 100644
--- a/gn2/wqflask/__init__.py
+++ b/gn2/wqflask/__init__.py
@@ -33,7 +33,7 @@ from gn2.wqflask.api.markdown import blogs_blueprint
from gn2.wqflask.api.markdown import news_blueprint
from gn2.wqflask.api.jobs import jobs as jobs_bp
from gn2.wqflask.oauth2.routes import oauth2
-from gn2.wqflask.oauth2.checks import user_logged_in
+from gn2.wqflask.oauth2.client import user_logged_in
from gn2.wqflask.oauth2.collections import num_collections
from gn2.wqflask.oauth2.request_utils import user_details, authserver_authorise_uri
diff --git a/gn2/wqflask/collect.py b/gn2/wqflask/collect.py
index 21168908..9e0640a5 100644
--- a/gn2/wqflask/collect.py
+++ b/gn2/wqflask/collect.py
@@ -27,7 +27,7 @@ from gn2.base.data_set import create_dataset
from gn2.wqflask.oauth2 import client
from gn2.wqflask.oauth2 import session
from gn2.wqflask.oauth2.session import session_info
-from gn2.wqflask.oauth2.checks import user_logged_in
+from gn2.wqflask.oauth2.client import user_logged_in
from gn2.wqflask.oauth2.request_utils import (
process_error, with_flash_error, with_flash_success)
from gn2.wqflask.oauth2.client import (
diff --git a/gn2/wqflask/decorators.py b/gn2/wqflask/decorators.py
index 54fde586..5f791254 100644
--- a/gn2/wqflask/decorators.py
+++ b/gn2/wqflask/decorators.py
@@ -11,7 +11,7 @@ from gn3.authentication import AdminRole
from gn2.wqflask.oauth2 import client
from gn2.wqflask.oauth2.session import session_info
-from gn2.wqflask.oauth2.checks import user_logged_in
+from gn2.wqflask.oauth2.client import user_logged_in
from gn2.wqflask.oauth2.request_utils import process_error
diff --git a/gn2/wqflask/oauth2/checks.py b/gn2/wqflask/oauth2/checks.py
index 4233e376..9a633b95 100644
--- a/gn2/wqflask/oauth2/checks.py
+++ b/gn2/wqflask/oauth2/checks.py
@@ -4,11 +4,13 @@ from urllib.parse import urljoin
from authlib.integrations.requests_client import OAuth2Session
from flask import (
- flash, request, url_for, redirect, current_app, session as flask_session)
+ flash, request, redirect, session as flask_session)
from . import session
from .client import (
- authserver_uri, user_logged_in, oauth2_clientid, oauth2_clientsecret)
+ authserver_uri, oauth2_clientid, oauth2_clientsecret, oauth2_get)
+from .session import clear_session_info
+
def require_oauth2(func):
"""Decorator for ensuring user is logged in."""
diff --git a/gn2/wqflask/oauth2/collections.py b/gn2/wqflask/oauth2/collections.py
index 63bf206e..994867b8 100644
--- a/gn2/wqflask/oauth2/collections.py
+++ b/gn2/wqflask/oauth2/collections.py
@@ -1,6 +1,6 @@
"""Functions for collections."""
from .session import session_info
-from .checks import user_logged_in
+from .client import user_logged_in
from .client import oauth2_get, no_token_get
def num_collections() -> int:
diff --git a/gn2/wqflask/oauth2/toplevel.py b/gn2/wqflask/oauth2/toplevel.py
index 65f60067..dffc0a7c 100644
--- a/gn2/wqflask/oauth2/toplevel.py
+++ b/gn2/wqflask/oauth2/toplevel.py
@@ -6,8 +6,8 @@ from flask import (
current_app as app)
from . import session
-from .client import SCOPE, no_token_post
-from .checks import require_oauth2, user_logged_in
+from .client import SCOPE, no_token_post, user_logged_in
+from .checks import require_oauth2
from .request_utils import user_details, process_error
toplevel = Blueprint("toplevel", __name__)
diff --git a/gn2/wqflask/oauth2/ui.py b/gn2/wqflask/oauth2/ui.py
index 04ec3292..cf2e9af7 100644
--- a/gn2/wqflask/oauth2/ui.py
+++ b/gn2/wqflask/oauth2/ui.py
@@ -2,7 +2,7 @@
from flask import session, render_template
from .client import oauth2_get
-from .checks import user_logged_in
+from .client import user_logged_in
from .request_utils import process_error
def render_ui(templatepath: str, **kwargs):
diff --git a/gn2/wqflask/oauth2/users.py b/gn2/wqflask/oauth2/users.py
index 894cce5b..3b2f264a 100644
--- a/gn2/wqflask/oauth2/users.py
+++ b/gn2/wqflask/oauth2/users.py
@@ -10,8 +10,9 @@ from flask import (
from . import client
from . import session
from .ui import render_ui
-from .checks import require_oauth2, user_logged_in
-from .client import oauth2_get, oauth2_post, oauth2_client, authserver_uri
+from .checks import require_oauth2
+from .client import (oauth2_get, oauth2_post, oauth2_client,
+ authserver_uri, user_logged_in)
from .request_utils import (
user_details, request_error, process_error, with_flash_error)
diff --git a/gn2/wqflask/views.py b/gn2/wqflask/views.py
index 81e92c9b..81cacecf 100644
--- a/gn2/wqflask/views.py
+++ b/gn2/wqflask/views.py
@@ -96,7 +96,7 @@ from gn2.wqflask.database import database_connection
import gn2.jobs.jobs as jobs
from gn2.wqflask.oauth2.session import session_info
-from gn2.wqflask.oauth2.checks import user_logged_in
+from gn2.wqflask.oauth2.client import user_logged_in
from gn2.wqflask import requests as monad_requests