From 19df5ae0329d615526836f8c553d5b7dcbb21900 Mon Sep 17 00:00:00 2001 From: Michael Jett Date: Tue, 11 Sep 2012 11:32:25 -0400 Subject: [PATCH] Timeout form updates. Logo URL updates --- .../src/main/webapp/resources/js/app.js | 26 ++++++------- .../webapp/resources/template/client.html | 37 +++++++++---------- 2 files changed, 31 insertions(+), 32 deletions(-) diff --git a/openid-connect-server/src/main/webapp/resources/js/app.js b/openid-connect-server/src/main/webapp/resources/js/app.js index 9b80dac62..c6be6a106 100644 --- a/openid-connect-server/src/main/webapp/resources/js/app.js +++ b/openid-connect-server/src/main/webapp/resources/js/app.js @@ -145,14 +145,6 @@ pattern:/^[\w ]+$/, minlength:3,*/ maxlength:200 - }, - accessTokenValiditySeconds: { - required: true, - type:"number" - }, - refreshTokenValiditySeconds: { - required: true, - type:"number" } }, @@ -346,9 +338,8 @@ previewLogo:function(event) { if ($('#logoUrl input').val()) { - //$('#logoBlock').show(); $('#logoPreview').empty(); - $('#logoPreview').append(''); + $('#logoPreview').attr('src', $('#logoUrl input').val()); } else { //$('#logoBlock').hide(); } @@ -408,6 +399,11 @@ $('#clientSecretGenerated').hide(); } }, + + getFormTokenValue:function(value) { + if (value == "") return null; + else return value; + }, saveClient:function (event) { @@ -440,12 +436,16 @@ logoUrl:$('#logoUrl input').val(), allowRefresh:$('#allowRefresh').is(':checked'), authorizedGrantTypes: authorizedGrantTypes, - accessTokenValiditySeconds: $('#accessTokenValiditySeconds input').val(), - refreshTokenValiditySeconds: $('#refreshTokenValiditySeconds input').val(), - idTokenValiditySeconds: $('#idTokenValiditySeconds input').val(), + accessTokenValiditySeconds: this.getFormTokenValue($('#accessTokenValiditySeconds input').val()), + refreshTokenValiditySeconds: this.getFormTokenValue($('#refreshTokenValiditySeconds input').val()), + idTokenValiditySeconds: this.getFormTokenValue($('#idTokenValiditySeconds input').val()), scope: this.scopeCollection.pluck("item") }); + if (this.model.get("allowRefresh") == false) { + this.model.set("refreshTokenValiditySeconds",null); + } + if (valid) { var _self = this; diff --git a/openid-connect-server/src/main/webapp/resources/template/client.html b/openid-connect-server/src/main/webapp/resources/template/client.html index 345bc7f32..d665c03a3 100644 --- a/openid-connect-server/src/main/webapp/resources/template/client.html +++ b/openid-connect-server/src/main/webapp/resources/template/client.html @@ -93,9 +93,7 @@
-
    -
  • -
+ logo
@@ -177,10 +175,23 @@ Timeout
- seconds
-

Enter this time in seconds

+

Enter this time in seconds. Leave blank if the token does not timeout.

+
+ + + +
+ +
+
+ seconds +
+

Enter this time in seconds. Leave blank if the token does not timeout.

@@ -198,22 +209,10 @@ Timeout
- seconds
-

Enter this time in seconds

-
- - -
- -
-
- seconds -
-

Enter this time in seconds

+

Enter this time in seconds. Leave blank if the token does not timeout.