aboutsummaryrefslogtreecommitdiff
path: root/gn_auth/templates/admin
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/templates/admin
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/templates/admin')
-rw-r--r--gn_auth/templates/admin/view-oauth2-client.html25
1 files changed, 10 insertions, 15 deletions
diff --git a/gn_auth/templates/admin/view-oauth2-client.html b/gn_auth/templates/admin/view-oauth2-client.html
index 9bc2c0d..3ec0c51 100644
--- a/gn_auth/templates/admin/view-oauth2-client.html
+++ b/gn_auth/templates/admin/view-oauth2-client.html
@@ -49,24 +49,19 @@
<fieldset>
<legend>Grants</legend>
- <input name="grants[]"
- type="checkbox"
- value="authorization_code"
- id="chk:authorization-code"
- {%if "authorization_code" in client.client_metadata.grant_types%}
- checked="checked"
- {%endif%} />
- <label for="chk:authorization-code">Authorization Code</label>
- <br /><br />
-
+ {%for granttype in granttypes%}
<input name="grants[]"
type="checkbox"
- value="refresh_token"
- id="chk:refresh-token"
- {%if "refresh_token" in client.client_metadata.grant_types%}
+ value="{{granttype.value}}"
+ id="chk-{{granttype.name.lower().replace(' ', '-')}}"
+ {%if granttype.value in client.client_metadata.grant_types%}
checked="checked"
- {%endif%} />
- <label for="chk:refresh-token">Refresh Token</label>
+ {%endif%} />
+ <label for="chk-{{granttype.name.lower().replace(' ', '-')}}">
+ {{granttype.name}}
+ </label>
+ <br /><br />
+ {%endfor%}
</fieldset>
<input type="submit" value="update client" />