common.js 로그인 반영 개선

This commit is contained in:
Lectom C Han
2026-02-05 13:07:39 +09:00
parent 422991aaf5
commit 1cdfe27ef7
3 changed files with 71 additions and 10 deletions

View File

@@ -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);