aboutsummaryrefslogtreecommitdiff
path: root/gn_auth/auth
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-05-02 05:43:03 +0300
committerFrederick Muriuki Muriithi2024-05-02 05:43:03 +0300
commitb80924613a641110bb05d5129fd485698006c3dc (patch)
tree11ab5ca6dcf3e45cc2c24cb9d149de128100f203 /gn_auth/auth
parent1f25d024040e17ad86472fb29f17753218b9c119 (diff)
downloadgn-auth-b80924613a641110bb05d5129fd485698006c3dc.tar.gz
Fix editing of grant_types
This commit makes the values for the grant types dynamic, enabling adding and/or removing of supported grant types. The editing was not updating the grant type values correctly either - we update the metadata key from "grants" to "grant_types" to fix that.
Diffstat (limited to 'gn_auth/auth')
-rw-r--r--gn_auth/auth/authorisation/users/admin/views.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/gn_auth/auth/authorisation/users/admin/views.py b/gn_auth/auth/authorisation/users/admin/views.py
index 3018a62..b0bb2db 100644
--- a/gn_auth/auth/authorisation/users/admin/views.py
+++ b/gn_auth/auth/authorisation/users/admin/views.py
@@ -256,7 +256,8 @@ def view_client(client_id: uuid.UUID):
return render_template(
"admin/view-oauth2-client.html",
client=with_db_connection(partial(oauth2_client, client_id=client_id)),
- scope=current_app.config["OAUTH2_SCOPE"])
+ scope=current_app.config["OAUTH2_SCOPE"],
+ granttypes=_FORM_GRANT_TYPES_)
@admin.route("/edit-client", methods=["POST"])
@is_admin
@@ -283,7 +284,7 @@ def edit_client():
"redirect_uris": list(set(
[form["redirect_uri"]] +
form["other_redirect_uris"].split("\r\n"))),
- "grants": form.getlist("grants[]"),
+ "grant_types": form.getlist("grants[]"),
"scope": form.getlist("scope[]")
}
with_db_connection(partial(save_client, the_client=OAuth2Client(