V6 SECURE ADMIN

관리자 로그인

Supabase Auth에 등록된 관리자 계정으로 로그인합니다.

홈페이지

'); popup.document.close(); try{ if(typeof sb==='undefined')throw new Error('관리자 인증이 초기화되지 않았습니다.'); const {data:{session},error}=await sb.auth.getSession(); if(error||!session)throw new Error('관리자 로그인이 필요합니다.'); const response=await fetch(studioPath,{ headers:{Authorization:'Bearer '+session.access_token}, cache:'no-store' }); if(!response.ok){ throw new Error(response.status===403?'관리자 권한이 없습니다.':'이미지 스튜디오 불러오기 실패 ('+response.status+')'); } let html=await response.text(); const basePath=studioPath.startsWith('/full-studio/')?'/full-studio/':'/image-studio/'; html=html.replace(/]*)?>/i,match=>match+''); if(popup.closed)return; const nonce=crypto.randomUUID(); wgStudioSession={popup,nonce,kind:context?.kind||null,busy:false,ready:false}; popup.document.open(); popup.document.write(html); popup.document.close(); popup.focus(); if(context){ let tries=0; const send=()=>{ if(popup.closed||wgStudioSession?.nonce!==nonce||wgStudioSession.ready||tries++>=35)return; popup.postMessage({ channel:'wegong-image-studio', type:'initialize', nonce, kind:context.kind, initialUrl:context.initialUrl||'' },location.origin); setTimeout(send,400); }; setTimeout(send,500); } }catch(e){ if(!popup.closed){ popup.document.open(); popup.document.write('접근 오류

이미지 스튜디오를 열 수 없습니다.

'); popup.document.close(); const errorNode=popup.document.getElementById('error'); if(errorNode)errorNode.textContent=e.message||String(e); } } }