From 5eb884453ba41776d91712e97ec8b8e4b6d4599b Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Tue, 31 Jan 2023 04:00:36 +0300 Subject: oauth2: remove obsolete function. --- wqflask/wqflask/oauth2/client.py | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/wqflask/wqflask/oauth2/client.py b/wqflask/wqflask/oauth2/client.py index b28265f7..2bf3f94d 100644 --- a/wqflask/wqflask/oauth2/client.py +++ b/wqflask/wqflask/oauth2/client.py @@ -15,27 +15,6 @@ def oauth2_client(): scope=SCOPE, token_endpoint_auth_method="client_secret_post", token=session.get("oauth2_token")) -def get_endpoint(uri_path: str) -> Maybe: - token = session.get("oauth2_token", False) - if token and not bool(session.get("user_details", False)): - config = app.config - client = OAuth2Session( - config["OAUTH2_CLIENT_ID"], config["OAUTH2_CLIENT_SECRET"], - token=token) - resp = client.get( - urljoin(config["GN_SERVER_URL"], uri_path)) - resp_json = resp.json() - - if resp_json.get("error") == "invalid_token": - flash(resp_json["error_description"], "alert-danger") - flash("You are now logged out.", "alert-info") - session.pop("oauth2_token", None) - return Nothing - - return Just(resp_json) - - return Nothing - def oauth2_get(uri_path: str) -> Either: token = session.get("oauth2_token") config = app.config -- cgit v1.2.3