1 line
2.8 KiB
JavaScript
1 line
2.8 KiB
JavaScript
|
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7122],{9282:(e,o,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/logout",function(){return t(238)}])},3586:(e,o,t)=>{"use strict";async function i(){try{let e=await caches.keys();e[0]&&await Promise.all(e.map(e=>caches.delete(e)))}catch(e){console.log("Error in clearing cache =>",e.message)}}t.d(o,{A:()=>i})},238:(e,o,t)=>{"use strict";t.r(o),t.d(o,{__N_SSP:()=>g,default:()=>d});var i=t(4848),s=t(6540),l=t(3368),n=t.n(l),a=t(3698),c=t(3586),r=t(620),g=!0;function d(e){let{user:o,query:t}=e,l=(0,i.jsxs)(s.Fragment,{children:[(0,i.jsx)("title",{children:"Loging Out | Datasquirel"}),(0,i.jsx)("meta",{name:"description",content:"Login you out"}),(0,i.jsx)("script",{src:"https://accounts.google.com/gsi/client"}),(0,i.jsx)("script",{src:"https://connect.facebook.net/en_US/sdk.js",crossOrigin:"anonymous"})]});return s.useEffect(()=>{localStorage.setItem("user","{}"),localStorage.removeItem("csrf")},[]),s.useEffect(()=>{function e(){var e,i;return(null==t?void 0:t.invite)&&(null==t?void 0:t.login)?window.location.href="/login"+window.location.search:(null==t?void 0:t.login)||(null===(e=localStorage.getItem("logoutParadigm"))||void 0===e?void 0:e.match(/reset/))?window.location.href="/login":void((null==o?void 0:null===(i=o.social_platform)||void 0===i?void 0:i.match(/google/))&&localStorage.setItem("google_prompt_skipped","logout"),window.location.pathname="/")}(0,a.A)("/api/logoutUser").then(async t=>{await (0,c.A)();let i=await navigator.serviceWorker.getRegistrations();for(let e=0;e<i.length;e++){let o=i[e];await o.unregister()}try{FB.init({appId:"",cookie:!0,xfbml:!0,version:"v13.0"}),FB.getLoginStatus(t=>{if(t.authResponse)FB.logout(o=>{e()});else{var i;google.accounts.id.initialize({client_id:""}),(null==o?void 0:null===(i=o.social_platform)||void 0===i?void 0:i.match(/google/))&&o.social_id?(google.accounts.id.revoke(),google.accounts.id.revoke(o.social_id,o=>{console.log(o.error),e()})):e()}})}catch(e){(0,a.A)("/api/admin/clientError",{method:"post",body:{component:"logout-page-component/lines-111-142",message:e.message,user:o}})}})},[]),(0,i.jsxs)(s.Fragment,{children:[(0,i.jsx)(n(),{children:l}),(0,i.jsx)("main",{className:"w-screen h-screen flex items-center justify-center p-4 md:p-8",children:(0,i.jsxs)("div",{className:"card max-w-md flex-col items-center bg-white p-6 rounded border border-slate-200 border-solid",children:[(0,i.jsxs)("a",{href:"/",className:"flex items-center gap-2",children:[(0,i.jsx)("img",{src:"/images/logo-icon-alt-2.png",alt:"Logo Icon",width:37}),(0,i.jsx)("span",{className:"font-bold text-2xl",children:"Datasquirel"})]}),(0,i.jsx)("h3",{className:"text-lg m-0 mt-4 text-slate-400",children:"Logging out"}),(0,i.jsx)(r.A,{position:"relative",width:"20px"})]})})]})}}},e=>{var o=o=>e(e.s=o);e.O(0,[636,6593,8792],()=>o(9282)),_N_E=e.O()}]);
|