Updated timeout functions

pull/210/head
Justin Richer 2012-09-13 11:24:48 -04:00
parent 6fdd088125
commit ebf77bea68
2 changed files with 38 additions and 17 deletions

View File

@ -429,6 +429,21 @@
clientSecret = $('#clientSecret').val(); clientSecret = $('#clientSecret').val();
} }
var accessTokenValiditySeconds = null;
if (!$('disableAccessTokenTimeout').is(':checked')) {
accessTokenValiditySeconds = this.getFormTokenValue($('#accessTokenValiditySeconds input[type=text]').val());
}
var idTokenValiditySeconds = null;
if (!$('disableIDTokenTimeout').is(':checked')) {
idTokenValiditySeconds = this.getFormTokenValue($('#idTokenValiditySeconds input[type=text]').val());
}
var refreshTokenValiditySeconds = null;
if ($('#allowRefresh').is(':checked') && !$('disableRefreshTokenTimeout').is(':checked')) {
refreshTokenValiditySeconds = this.getFormTokenValue($('#refreshTokenValiditySeconds input[type=text]').val());
}
var valid = this.model.set({ var valid = this.model.set({
applicationName:$('#applicationName input').val(), applicationName:$('#applicationName input').val(),
clientId:$('#clientId input').val(), clientId:$('#clientId input').val(),
@ -439,9 +454,9 @@
logoUrl:$('#logoUrl input').val(), logoUrl:$('#logoUrl input').val(),
allowRefresh:$('#allowRefresh').is(':checked'), allowRefresh:$('#allowRefresh').is(':checked'),
authorizedGrantTypes: authorizedGrantTypes, authorizedGrantTypes: authorizedGrantTypes,
accessTokenValiditySeconds: this.getFormTokenValue($('#accessTokenValiditySeconds input').val()), accessTokenValiditySeconds: accessTokenValiditySeconds,
refreshTokenValiditySeconds: this.getFormTokenValue($('#refreshTokenValiditySeconds input').val()), refreshTokenValiditySeconds: refreshTokenValiditySeconds,
idTokenValiditySeconds: this.getFormTokenValue($('#idTokenValiditySeconds input').val()), idTokenValiditySeconds: idTokenValiditySeconds,
scope: this.scopeCollection.pluck("item") scope: this.scopeCollection.pluck("item")
}); });

View File

@ -168,13 +168,15 @@
</div> </div>
<div class="control-group" id="accessTokenValiditySeconds"> <div class="control-group" id="accessTokenValiditySeconds">
<label class="control-label">Access Token <label class="control-label">Access Token Timeout</label>
Timeout</label>
<div class="controls"> <div class="controls">
<div>
<label class="checkbox">
<input type="checkbox" id="disableAccessTokenTimeout" <%=(accessTokenValiditySeconds == null ? 'checked' : '')%>/> Access tokens do not time out
</label>
</div>
<div class="input-append"> <div class="input-append">
<input type="text" class="" value="<%=(accessTokenValiditySeconds == null ? '' : accessTokenValiditySeconds)%>" id="access-token-timeout-seconds" size="16"><span <input type="text" class="" value="<%=(accessTokenValiditySeconds == null ? '' : accessTokenValiditySeconds)%>" id="access-token-timeout-seconds" size="16"><span class="add-on">seconds</span>
class="add-on">seconds</span>
<input type="checkbox" id="disableAccessTokenTimeout" <%=(accessTokenValiditySeconds == null ? 'checked' : '')%>/> disable timeout
</div> </div>
<p class="help-block">Enter this time in seconds.</p> <p class="help-block">Enter this time in seconds.</p>
</div> </div>
@ -182,13 +184,16 @@
<div class="control-group" id="idTokenValiditySeconds"> <div class="control-group" id="idTokenValiditySeconds">
<label class="control-label">ID Token <label class="control-label">ID Token Timeout</label>
Timeout</label>
<div class="controls"> <div class="controls">
<div>
<label class="checkbox">
<input type="checkbox" id="disableIDTokenTimeout" <%=(idTokenValiditySeconds == null ? 'checked' : '')%>/> ID Tokens do not time out
</label>
</div>
<div class="input-append"> <div class="input-append">
<input type="text" class="" value="<%=(idTokenValiditySeconds == null ? '' : idTokenValiditySeconds)%>" id="id-token-timeout-seconds" size="16"><span <input type="text" class="" value="<%=(idTokenValiditySeconds == null ? '' : idTokenValiditySeconds)%>" id="id-token-timeout-seconds" size="16"><span
class="add-on">seconds</span> class="add-on">seconds</span>
<input type="checkbox" id="disableIDTokenTimeout" <%=(idTokenValiditySeconds == null ? 'checked' : '')%>/> disable timeout
</div> </div>
<p class="help-block">Enter this time in seconds.</p> <p class="help-block">Enter this time in seconds.</p>
</div> </div>
@ -198,19 +203,20 @@
<label class="control-label">Refresh Tokens</label> <label class="control-label">Refresh Tokens</label>
<div class="controls"> <div class="controls">
<label class="checkbox"> <label class="checkbox">
<input type="checkbox" id="allowRefresh" <%=(allowRefresh == true ? 'checked' : '')%>> Allow refresh tokens? <input type="checkbox" id="allowRefresh" <%=(allowRefresh == true ? 'checked' : '')%>> Refresh tokens are issued for this client
</label> </label>
</div> </div>
</div> </div>
<div class="control-group" id="refreshTokenValiditySeconds"> <div class="control-group" id="refreshTokenValiditySeconds">
<label class="control-label">Refresh Token
Timeout</label>
<div class="controls"> <div class="controls">
<div>
<label class="checkbox">
<input type="checkbox" id="disableRefreshTokenTimeout" <%=(refreshTokenValiditySeconds == null ? 'checked' : '')%>/> Refresh tokens do not time out
</label>
</div>
<div class="input-append"> <div class="input-append">
<input type="text" class="" value="<%=(refreshTokenValiditySeconds == null ? '' : refreshTokenValiditySeconds)%>" id="refresh-token-timeout-seconds" size="16"><span <input type="text" class="" value="<%=(refreshTokenValiditySeconds == null ? '' : refreshTokenValiditySeconds)%>" id="refresh-token-timeout-seconds" size="16"><span class="add-on">seconds</span>
class="add-on">seconds</span>
<input type="checkbox" id="disableRefreshTokenTimeout" <%=(refreshTokenValiditySeconds == null ? 'checked' : '')%>/> disable timeout
</div> </div>
<p class="help-block">Enter this time in seconds.</p> <p class="help-block">Enter this time in seconds.</p>
</div> </div>