From 04a07b4f20da9a942b8ded979e0828ba5d60e89d Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 30 Jan 2023 19:12:16 +0300 Subject: oauth2: fix errors. --- wqflask/wqflask/oauth2/toplevel.py | 6 ++---- wqflask/wqflask/templates/oauth2/group_join_or_create.html | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/wqflask/wqflask/oauth2/toplevel.py b/wqflask/wqflask/oauth2/toplevel.py index a998909c..68ddac13 100644 --- a/wqflask/wqflask/oauth2/toplevel.py +++ b/wqflask/wqflask/oauth2/toplevel.py @@ -47,9 +47,7 @@ def logout(): if user_logged_in(): token = session.get("oauth2_token", False) config = app.config - client = OAuth2Session( - config["OAUTH2_CLIENT_ID"], config["OAUTH2_CLIENT_SECRET"], - scope = SCOPE, token=token) + client = oauth2_client() resp = client.revoke_token(urljoin(config["GN_SERVER_URL"], "oauth2/revoke")) keys = tuple(key for key in session.keys() if not key.startswith("_")) for key in keys: @@ -60,7 +58,7 @@ def logout(): @toplevel.route("/register-user", methods=["GET", "POST"]) def register_user(): if user_logged_in(): - next_endpoint=request.args.get("next", url_for("/")) + next_endpoint=request.args.get("next", "/") flash(("You cannot register a new user while logged in. " "Please logout to register a new user."), "alert-danger") diff --git a/wqflask/wqflask/templates/oauth2/group_join_or_create.html b/wqflask/wqflask/templates/oauth2/group_join_or_create.html index d0a10e1b..0ec5674b 100644 --- a/wqflask/wqflask/templates/oauth2/group_join_or_create.html +++ b/wqflask/wqflask/templates/oauth2/group_join_or_create.html @@ -22,7 +22,7 @@

You can only be a member of a single group.

-
Request to be added to group
@@ -56,7 +56,7 @@

You can only be a member of a single group.

- Create a new group
-- cgit v1.2.3