mirror of
https://github.com/documize/community.git
synced 2025-08-05 05:25:27 +02:00
updated is.js, refactored jwt code
This commit is contained in:
parent
74c9e76d09
commit
a585a55033
8 changed files with 751 additions and 620 deletions
|
@ -23,10 +23,12 @@ export default Ember.Component.extend({
|
|||
KeycloakUrlError: computed.empty('keycloakConfig.url'),
|
||||
KeycloakRealmError: computed.empty('keycloakConfig.realm'),
|
||||
KeycloakClientIdError: computed.empty('keycloakConfig.clientId'),
|
||||
KeycloakPublicKeyError: computed.empty('keycloakConfig.publicKey'),
|
||||
keycloakConfig: {
|
||||
url: '',
|
||||
realm: '',
|
||||
clientId: ''
|
||||
clientId: '',
|
||||
publicKey: '',
|
||||
},
|
||||
|
||||
didReceiveAttrs() {
|
||||
|
@ -81,6 +83,20 @@ export default Ember.Component.extend({
|
|||
this.$("#keycloak-clientId").focus();
|
||||
return;
|
||||
}
|
||||
if (this.get('KeycloakPublicKeyError')) {
|
||||
this.$("#keycloak-publicKey").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
let pk = this.get('keycloakConfig.publicKey');
|
||||
if (is.not.startWith(pk, '-----BEGIN PUBLIC KEY-----')) {
|
||||
pk = '-----BEGIN PUBLIC KEY-----' + pk;
|
||||
}
|
||||
if (is.not.endWith(pk, '-----END PUBLIC KEY-----')) {
|
||||
pk = pk + '-----END PUBLIC KEY-----' ;
|
||||
}
|
||||
|
||||
this.set('keycloakConfig.publicKey', pk);
|
||||
|
||||
config = this.get('keycloakConfig');
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue