mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
Fix bug 'if OIDC button text was customized, the default text will be added if a user click on sing in'
This commit is contained in:
parent
37a3fbf69c
commit
6cd59f8ce1
2 changed files with 52 additions and 6 deletions
|
|
@ -6,6 +6,9 @@ const i18nTagToT9n = i18nTag => {
|
|||
return i18nTag;
|
||||
};
|
||||
|
||||
let alreadyCheck = 1;
|
||||
let isCheckDone = false;
|
||||
|
||||
const validator = {
|
||||
set(obj, prop, value) {
|
||||
if (prop === 'state' && value !== 'signIn') {
|
||||
|
|
@ -166,6 +169,49 @@ Template.userFormsLayout.events({
|
|||
});
|
||||
}
|
||||
},
|
||||
'DOMSubtreeModified #at-oidc'(event){
|
||||
if(alreadyCheck <= 2){
|
||||
let currSetting = Settings.findOne();
|
||||
let oidcBtnElt = $("#at-oidc");
|
||||
if(currSetting && currSetting !== undefined && currSetting.oidcBtnText !== undefined && oidcBtnElt != null && oidcBtnElt != undefined){
|
||||
let htmlvalue = "<i class='fa fa-oidc'></i>" + currSetting.oidcBtnText;
|
||||
if(alreadyCheck == 1){
|
||||
alreadyCheck++;
|
||||
oidcBtnElt.html("");
|
||||
}
|
||||
else{
|
||||
alreadyCheck++;
|
||||
oidcBtnElt.html(htmlvalue);
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
alreadyCheck = 1;
|
||||
}
|
||||
},
|
||||
'DOMSubtreeModified .at-form'(event){
|
||||
if(alreadyCheck <= 2 && !isCheckDone){
|
||||
if(document.getElementById("at-oidc") != null){
|
||||
let currSetting = Settings.findOne();
|
||||
let oidcBtnElt = $("#at-oidc");
|
||||
if(currSetting && currSetting !== undefined && currSetting.oidcBtnText !== undefined && oidcBtnElt != null && oidcBtnElt != undefined){
|
||||
let htmlvalue = "<i class='fa fa-oidc'></i>" + currSetting.oidcBtnText;
|
||||
if(alreadyCheck == 1){
|
||||
alreadyCheck++;
|
||||
oidcBtnElt.html("");
|
||||
}
|
||||
else{
|
||||
alreadyCheck++;
|
||||
isCheckDone = true;
|
||||
oidcBtnElt.html(htmlvalue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
alreadyCheck = 1;
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
Template.defaultLayout.events({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue