PageSourceSearch

https://www.pory.app/_next/static/chunks/pages/_apps/[hostname]/account/login-8c47d1d530bdfdbe.js

js pory.app collected 2026-10-03 22:43:04 UTC 3,661 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[680],{16059:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_apps/[hostname]/account/login",function(){return t(26152)}])},26152:function(e,n,t){"use strict";t.r(n),t.d(n,{__N_SSP:function(){return j},default:function(){return m}});var i=t(97458),o=t(52983),s=t(5397),l=t(12722),r=t(41571),a=t(10613),d=t(51438),u=t(49108),c=t(24782),h=t(80870),g=t(23935),v=t(701),f=t(84757),w=t(16731),x=t(99836);function p(e){return null===e||""===e?e:(e=e.toString()).replace(/[^\x20-\x7E]/g,"").toLowerCase()}var j=!0;function m(e){var n,t,j,m;let{hostname:_,appConfig:y}=e,{session:E,status:C}=(0,w.k)(),[O,b]=(0,o.useState)(!1),k=(0,s.p)(),S=null==y?void 0:y.site,L=(0,h.oGX)({site:S}),P=(0,x.Z)({identityEnabled:!0}),F=null!==(m=null==y?void 0:null===(n=y.identity)||void 0===n?void 0:n.redirectOnLogin)&&void 0!==m?m:"/",N=null==y?void 0:null===(t=y.identity)||void 0===t?void 0:t.registrationRestrictions;(0,o.useEffect)(()=>{if("authenticated"===C){var e;(null==E?void 0:null===(e=E.user)||void 0===e?void 0:e.id)||(console.log("user is in an in between some weird state"),(0,c.signOut)())}},[C]),(0,o.useEffect)(()=>{"authenticated"===C&&O&&(location.href=F)},[C,O]);let T=async e=>{let{email:n}=e;try{return(await v.Z.post("/api/".concat(_,"/auth/otp"),{email:n})).data}catch(n){var t,i;let e=null==n?void 0:null===(i=n.response)||void 0===i?void 0:null===(t=i.data)||void 0===t?void 0:t.message;throw(0,h.CFj)({toast:k,isSuccess:!1,message:null!=e?e:"Something went wrong. Please try again."}),n}},I=async e=>{try{let{exists:n}=await P.userProfile.validateEmail(p(e));return n||(0,h.CFj)({toast:k,status:"info",title:"User does not exist",message:"An account with this email does not exist."}),{exists:n}}catch(n){let e=(0,g.e$)({error:n});throw(0,h.CFj)({toast:k,status:"error",title:"Error",message:e}),n}},X=async e=>{let{email:n,password:t}=e,i=await (0,c.signIn)("credentials",{username:p(n.toLowerCase()),password:t,app:_,client:null==y?void 0:y.client,redirect:!1});(null==i?void 0:i.status)!==200&&(null==i?void 0:i.status)!==201||i.error||b(!0),(null==i?void 0:i.status)===401&&(0,h.CFj)({toast:k,status:"error",title:"Sign in",message:"Incorrect username or password"})};return(0,i.jsx)(f.$l,{site:{...S,contents:{...S.contents,header:void 0}},identityEnabled:!1,registrationRestrictions:N,redirectOnLogout:null==y?void 0:null===(j=y.identity)||void 0===j?void 0:j.redirectOnLogout,metaTags:(0,i.jsx)(f._b,{preventCustomCode:!0,site:S,page:null,overrideTitle:"Log in • ".concat(null==S?void 0:S.siteName)}),pageProps:{bgColor:"gray.50"},children:(0,i.jsx)(l.x,{h:"100vh",w:"100%",children:(0,i.jsxs)(r.M,{h:"full",w:"full",children:["loading"===C&&(0,i.jsx)(h.TKf,{color:"black"}),"authenticated"===C&&!O&&(0,i.jsxs)(h.Zbd,{width:{base:"100%",md:"420px"},shadow:"none",children:[(0,i.jsx)(h.Ol2,{children:(0,i.jsx)(h.X6q,{fontSize:"xl",children:"You Are Already Logged In"})}),(0,i.jsx)(h.aYP,{children:(0,i.jsxs)(a.K,{spacing:4,children:[(0,i.jsx)(h.xvT,{children:"You are already signed in. To sign into another account, please sign out first."}),(0,i.jsxs)(a.K,{spacing:2,children:[(0,i.jsx)(d.z,{w:"full",as:u.r,href:"/",textDecor:"none",children:"Back to home"}),(0,i.jsx)(d.z,{w:"full",onClick:()=>{(0,c.signOut)()},children:"Sign Out"})]})]})})]}),"loading"!==C&&"unauthenticated"===C&&(0,i.jsx)(h.mdO,{isEditor:!1,config:L,validateEmailFn:I,loginWithPasswordFn:X,loginWithMagicLinkFn:T,children:(0,i.jsx)(h.m35,{isInviteOnly:null==N?void 0:N.includes(g.$c.InviteOnly)})})]})})})}}},function(e){e.O(0,[923,125,757,888,774,179],function(){return e(e.s=16059)}),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.