common.js 로그인 반영 개선
This commit is contained in:
@@ -4921,18 +4921,28 @@ var Swiper=function(){"use strict";function e(e){return null!==e&&"object"==type
|
||||
const buttons = document.querySelectorAll('[data-oidc-login]');
|
||||
if (!buttons.length) return;
|
||||
buttons.forEach((button) => {
|
||||
button.addEventListener('click', openOidcLogin);
|
||||
if (button.dataset.oidcBound === '1') return;
|
||||
button.dataset.oidcBound = '1';
|
||||
button.addEventListener('click', (event) => {
|
||||
event.preventDefault();
|
||||
window.openOidcLogin();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
window.openOidcLogin = openOidcLogin;
|
||||
window.login = openOidcLogin;
|
||||
if (!window.openOidcLogin) {
|
||||
window.openOidcLogin = openOidcLogin;
|
||||
}
|
||||
window.login = window.openOidcLogin;
|
||||
|
||||
window.addEventListener('message', (event) => {
|
||||
if (event.data && event.data.type === 'OIDC_LOGIN_SUCCESS') {
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
if (!window.__oidcLoginMessageBound) {
|
||||
window.addEventListener('message', (event) => {
|
||||
if (event.data && event.data.type === 'OIDC_LOGIN_SUCCESS') {
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
window.__oidcLoginMessageBound = true;
|
||||
}
|
||||
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', bindOidcButtons);
|
||||
|
||||
Reference in New Issue
Block a user