aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-01-30 19:12:16 +0300
committerFrederick Muriuki Muriithi2023-01-30 19:12:16 +0300
commit04a07b4f20da9a942b8ded979e0828ba5d60e89d (patch)
treeea59e72c251dc562f9d1f38bc359f412b0e97b6a /wqflask
parentf783e93bd80a75b1a9f0ea115e4136c4c4fbd092 (diff)
downloadgenenetwork2-04a07b4f20da9a942b8ded979e0828ba5d60e89d.tar.gz
oauth2: fix errors.
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/oauth2/toplevel.py6
-rw-r--r--wqflask/wqflask/templates/oauth2/group_join_or_create.html4
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 @@
<p>You can only be a member of a single group.</p>
</div>
- <form action="{{url_for('oauth2.request_add_to_group')}}"
+ <form action="{{url_for('oauth2.user.request_add_to_group')}}"
method="POST">
<legend>Request to be added to group</legend>
<div class="form-group">
@@ -56,7 +56,7 @@
<p>You can only be a member of a single group.</p>
</div>
- <form action="{{url_for('oauth2.create_group')}}"
+ <form action="{{url_for('oauth2.group.create_group')}}"
method="POST">
<legend>Create a new group</legend>
<div class="form-group mytooltip">