앞선 커밋이 CHANGELOG 에 주장한 "로딩 표시가 나오지 않던 문제 수정" 이 실제로 화면에 나타나는지 브라우저로 확정했다. 전달 경로부터 DOM 마운트·해제까지 측정했고, 지연·에러 응답에서도 영구 로딩이 남지 않음을 확인했다. 측정 과정에서 앞선 세션의 판단 하나가 틀렸음을 확인했다 — "오버레이 DOM 이 어느 화면에서도 관측되지 않는다" 는 관측 대상 노드를 잘못 잡은 것이었다. 스피너 방식 레이아웃은 다른 노드를 쓰며, 대조군에서도 안 보였던 이유가 이것이다. 미뤄 두었던 과제 4건을 함께 구현했다. - 인증창을 그냥 닫고 이탈하면 그 인증 요청을 서버에도 종료로 표시한다. 이전에는 브라우저만 알고 있어 인증 이력에 "보낸 뒤 소식 없는" 항목이 남았다 - 플러그인 설정 화면이 저장된 비밀값을 다시 내려받던 것을 가려서 표시한다. 그 항목을 건드리지 않고 저장하면 저장된 값이 그대로 유지된다 - 언어팩 반영 누락 검사가 버전만 비교해 "버전 같고 내용 다름" 을 놓치던 사각을 콘텐츠 비교로 닫았다 - 확장이 검증 규칙을 추가할 때 쓰는 필터 이름 6개를 표준 형태로 통일했다. 예전 이름도 함께 발행하므로 기존 확장은 수정 없이 동작한다 정적 검사 룰 2종의 오탐·사각을 함께 고쳤고, 개명으로 검사 대상에 편입된 파일의 사전 결함 8건을 해소했다. 검수용 데이터는 전량 정리했다.
3 lines
8.4 KiB
JavaScript
3 lines
8.4 KiB
JavaScript
var SirsoftVerificationNhnkcp=function(c){"use strict";const i="sirsoft-verification_nhnkcp",M="nhnkcp",k="width=410,height=500,scrollbars=yes,resizable=yes",E="kcp_cert_popup",S="identity-challenge-modal",A="g7.identity.redirectStash",h="sirsoft-verification_nhnkcp.formStash",l={info:(...e)=>console.info(`[${i}]`,...e),warn:(...e)=>console.warn(`[${i}]`,...e),error:(...e)=>console.error(`[${i}]`,...e)};function u(){return window.G7Core??null}const R={9999:`$t:${i}.errors.cancelled`,NOT_ADULT:`$t:${i}.errors.not_adult`,DUPLICATE:`$t:${i}.errors.duplicate`,REMOTE_CALL_FAILED:`$t:${i}.errors.remote_call_failed`,DECRYPT_FAILED:`$t:${i}.errors.decrypt_failed`,INCOMPLETE_IDENTITY:`$t:${i}.errors.incomplete_identity`,NOT_FOUND:`$t:${i}.errors.not_found`,ALREADY_CONSUMED:`$t:${i}.errors.already_consumed`,EXPIRED:`$t:${i}.errors.not_found`,IDENTITY_BINDING_MISMATCH:`$t:${i}.errors.binding_mismatch`,STORAGE_FAILED:`$t:${i}.errors.storage_failed`,PROVIDER_ERROR:`$t:${i}.errors.verify_failed`},v=`$t:${i}.errors.verify_failed`,T=new Set(["NOT_ADULT","DUPLICATE"]);function F(e){return R[e]??v}function g(e,t){const n=R[e];if(n)return n;const r=(t??"").trim();return r===""?v:e?`[${e}] ${r}`:r}const N=1023;function b(){if(typeof window>"u")return!1;const e=window.navigator?.userAgent??"";return/Android|iPhone|iPad|iPod|IEMobile|Opera Mini/i.test(e)?!0:typeof window.innerWidth=="number"&&window.innerWidth<=N}function p(e){const t=u()?.state?.set;typeof t=="function"&&t({identityChallenge:{providerInProgress:e}})}function I(){const e=u()?.identity?.markDomainNoticeShown;if(typeof e=="function")try{e()}catch{}}async function _(e,t="error"){const n=u()?.dispatch;if(typeof n=="function")try{await n({handler:"toast",params:{type:t,message:e}})}catch{}}function O(e,t){const n=document.createElement("form");n.setAttribute("name","kcpCertForm"),n.setAttribute("method","POST"),n.setAttribute("action",e.call_url),n.setAttribute("target",t),n.setAttribute("accept-charset","UTF-8"),n.style.display="none";const r={reg_cert_key:e.reg_cert_key,kcp_page_submit_yn:"Y"};for(const[o,s]of Object.entries(r)){const a=document.createElement("input");a.type="hidden",a.name=o,a.value=s,n.appendChild(a)}document.body.appendChild(n),n.submit(),window.setTimeout(()=>{try{n.remove()}catch{}},0)}function U(){try{window.sessionStorage.setItem(A,JSON.stringify({return_url:window.location.href,payload:{},stashed_at:Date.now()}))}catch(e){l.warn("복귀 주소 보관 실패 — 인증 후 처음 화면으로 돌아갈 수 있습니다.",e)}try{window.sessionStorage.setItem(h,JSON.stringify({fields:G(),stashed_at:Date.now()}))}catch(e){l.warn("입력값 보관 실패",e)}}function G(){const e={};return document.querySelectorAll("input[name], select[name], textarea[name]").forEach(n=>{const r=n.getAttribute("name")??"";if(!r)return;const o=(n.getAttribute("type")??"").toLowerCase();if(o==="password"||o==="file"||o==="hidden")return;if(o==="checkbox"||o==="radio"){n.checked&&(e[r]=String(n.value??"on"));return}const s=String(n.value??"");s!==""&&(e[r]=s)}),e}function H(e){const t=Object.keys(e);if(t.length===0)return;let n=0;const r=window.setInterval(()=>{n+=1;let o=0;t.forEach(s=>{const a=document.querySelector(`[name="${Y(s)}"]`);if(!a)return;const d=(a.getAttribute("type")??"").toLowerCase();if(d==="checkbox"||d==="radio"){const f=a;f.value===e[s]&&!f.checked&&f.click(),o+=1;return}j(a,e[s]),o+=1}),(o===t.length||n>=25)&&window.clearInterval(r)},200)}function Y(e){const t=globalThis.CSS;return t&&typeof t.escape=="function"?t.escape(e):e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function j(e,t){const n=Object.getPrototypeOf(e),r=Object.getOwnPropertyDescriptor(n,"value");r?.set?r.set.call(e,t):e.value=t,e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0}))}function K(e){const t=u()?.dispatch;return typeof t!="function"?Promise.resolve():t({handler:"sequence",params:{actions:[{handler:"resolveIdentityChallenge",params:e},{handler:"closeModal",target:S}]}}).catch(()=>{})}const P=new Set;function $(e){e&&P.add(e)}function V(e){return!!e&&P.has(e)}async function B(e){if(!e)return;const t=u()?.api?.getToken?.()??null;try{await fetch(`/api/identity/challenges/${encodeURIComponent(e)}/cancel`,{method:"POST",credentials:"include",headers:{Accept:"application/json",...t?{Authorization:`Bearer ${t}`}:{}}})}catch(n){l.warn("이탈 거래 취소 통보 실패 (재시도 흐름에는 영향 없음)",n)}}async function q(e){const t=u(),n={purpose:e.purpose};e.provider_id&&(n.provider_id=e.provider_id),e.target&&(n.target=e.target);try{const r=t?.api?.getToken?.()??null,o=(()=>{try{return window.localStorage?.getItem("g7_locale")}catch{return null}})(),s=await fetch("/api/identity/challenges",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",Accept:"application/json",...o?{"Accept-Language":o}:{},...r?{Authorization:`Bearer ${r}`}:{}},body:JSON.stringify(n)}),a=await s.json().catch(()=>null);if(!s.ok||!a?.success)return l.error("challenge 재발급 실패",a),null;const d=a.data??a,f={...e,challenge_id:d.id,expires_at:d.expires_at,public_payload:d.public_payload??{},error:null};return t?.state?.set?.({identityChallenge:f}),f}catch(r){return l.error("challenge 재발급 중 오류",r),null}}async function y(){const e=u();let t=e?.state?.getGlobal?.()?.identityChallenge??e?.state?.get?.()?.identityChallenge;if(!t){l.error("_global.identityChallenge 미설정 — 코어 모달 진입 흐름 확인 필요");return}if(V(t.challenge_id)){const o=await q(t);if(!o){await _(`$t:${i}.modal.payload_not_ready`);return}t=o}const n=t.public_payload;if(!n?.call_url||!n?.reg_cert_key){l.error("public_payload 의 call_url/reg_cert_key 부재 — 거래등록 응답 확인 필요",n),await _(`$t:${i}.modal.payload_not_ready`);return}if(b()){U(),p(!0),O(n,"_self");return}const r=window.open("",E,k);if(!r){l.error("window.open null — 팝업 차단됨"),await _(`$t:${i}.modal.popup_blocked`);return}p(!0),O(n,E),J(r)}function J(e){let t=!1,n=null,r=null;const o=()=>{r&&(window.removeEventListener("message",r),r=null),n!==null&&(window.clearInterval(n),n=null)};r=s=>{if(s.origin!==window.location.origin)return;const a=s.data;if(!a||a.type!=="identity_result"||t)return;t=!0,o();try{e.close()}catch{}if(p(!1),a.identity_error){const f=a.challenge_id||u()?.state?.getGlobal?.()?.identityChallenge?.challenge_id;$(f),T.has(a.identity_error)&&I(),_(g(a.identity_error,a.identity_error_message),"error");return}const d=a.verification_token?{result:"verified",token:a.verification_token}:{result:"cancelled"};K(d)},window.addEventListener("message",r),n=window.setInterval(()=>{if(t){o();return}if(e.closed){t=!0,o(),p(!1);const s=u()?.state?.getGlobal?.()?.identityChallenge?.challenge_id;$(s),B(s)}},500)}function w(){if(typeof window>"u")return;const e=new URLSearchParams(window.location.search),t=e.get("verification_token")??"",n=e.get("identity_error")??"";if(t===""&&n==="")return;const r=W();if(r&&H(r.fields),t!==""){_(`$t:${i}.modal.mobile_return_success`,"success");return}T.has(n)&&I(),_(g(n,e.get("identity_error_message")??void 0),"error"),e.delete("identity_error"),e.delete("identity_error_message");const o=e.toString(),s=window.location.pathname+(o?`?${o}`:"")+window.location.hash;try{window.history.replaceState(null,"",s)}catch{}}function W(){let e=null;try{e=window.sessionStorage.getItem(h),window.sessionStorage.removeItem(h)}catch{return null}if(!e)return null;try{const t=JSON.parse(e);return!t?.fields||typeof t.stashed_at!="number"||Date.now()-t.stashed_at>6e5?null:t}catch{return null}}function C(){const t=u()?.getActionDispatcher;if(typeof t!="function")return!1;const n=t();return!n||typeof n.registerHandler!="function"?!1:(n.registerHandler(`${i}.startAuth`,y,{category:"plugin",source:i}),l.info("startAuth handler registered"),!0)}function D(){if(C())return;let e=0;const t=window.setInterval(()=>{e++,(C()||e>=50)&&(window.clearInterval(t),e>=50&&l.warn("G7Core ActionDispatcher 미준비 — handler 등록 실패"))},100)}function L(){D()}function m(){w(),D()}return m(),window.__SirsoftVerificationNhnkcp={identifier:i,init:m,initPlugin:L,startAuthHandler:y,handleMobileReturn:w},c.FORM_STASH_KEY=h,c.MODAL_ID=S,c.PLUGIN_IDENTIFIER=i,c.PROVIDER_ID=M,c.REDIRECT_STASH_KEY=A,c.handleMobileReturn=w,c.init=m,c.initPlugin=L,c.isMobileEnvironment=b,c.resolveFailureMessage=g,c.resolveFailureMessageKey=F,c.startAuthHandler=y,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"}),c}({});
|
|
//# sourceMappingURL=plugin.iife.js.map
|