PageSourceSearch

https://pika.style/_next/static/chunks/pages/reset-password-9721cd1f8d35248b.js

js pika.style collected 2026-10-03 21:24:28 UTC 3,762 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7537],{6444:(e,r,s)=>{"use strict";s.r(r),s.d(r,{default:()=>u});var t=s(75038),a=s(76430),o=s(21958),n=s(56725),l=s(34530),i=s(19977),d=s(1433),c=s(92376);let u=()=>{let e=(0,c.useRouter)(),[r,s]=(0,a.useState)({email:null,newPassword:null}),[u,w]=(0,a.useState)(!1),[p,h]=(0,a.useState)(!0);(0,a.useEffect)(()=>{let r=(0,i.U)();if("true"===e.query.recovery){w(!0),h(!1);return}let{data:{subscription:s}}=r.auth.onAuthStateChange(e=>{"PASSWORD_RECOVERY"===e&&(w(!0),h(!1))}),t=window.location.hash;if(t){let e,a,o=t.substring(1).split("&").map(e=>e.split("="));for(let[r,s]of o)"type"===r?e=s:"access_token"===r&&(a=s);if("recovery"===e&&a&&"object"!=typeof a)return r.auth.setSession({access_token:a,refresh_token:o.find(([e])=>"refresh_token"===e)?.[1]??""}).then(({error:e})=>{e?d.oR.error("Recovery link is invalid or has expired. Please request a new one."):w(!0),h(!1)}),()=>s.unsubscribe()}return h(!1),()=>s.unsubscribe()},[e.query.recovery]);let m=async t=>{if(t.preventDefault(),!r?.newPassword||r.newPassword.length<6)return void d.oR.error("Password must be at least 6 characters");let a=d.oR.loading("Changing password");try{let t=(0,i.U)(),{error:o}=await t.auth.updateUser({password:r?.newPassword});o?d.oR.error(o.message,{id:a}):(s({newPassword:null,email:null}),d.oR.success("Password changed successfully!",{id:a}),e.push("/"))}catch{d.oR.error("Something went wrong, please try again",{id:a})}},x=async()=>{if(!r?.email)return void d.oR.error("Please enter your email");let e=d.oR.loading("Finding your account..."),s=(0,i.U)(),{data:t,error:a}=await s.auth.resetPasswordForEmail(r?.email,{redirectTo:"https://pika.style/reset-password"});a?d.oR.error(a.message,{id:e}):t&&d.oR.success("Please check your email for password recovery",{id:e})};return p?(0,t.jsxs)("div",{children:[(0,t.jsx)(n.bV,{title:"Reset Password – Pika",noindex:!0,nofollow:!0}),(0,t.jsx)(o.A,{}),(0,t.jsx)(l.mc,{width:"1080px",className:"pt-20 relative",children:(0,t.jsx)("div",{className:"flex items-center justify-center min-h-[300px]",children:(0,t.jsx)("p",{className:"text-gray-500",children:"Verifying recovery link..."})})})]}):(0,t.jsxs)("div",{children:[(0,t.jsx)(n.bV,{title:"Reset Password – Pika",noindex:!0,nofollow:!0,openGraph:{title:"Reset Password – Pika"}}),(0,t.jsx)("div",{className:"min-h-screen object-cover text-gray-200 opacity-[0.03] dark:invert fixed inset-0",style:{background:"url(/dotted.svg) repeat",backgroundSize:"5%"}}),(0,t.jsx)(o.A,{}),(0,t.jsxs)(l.mc,{width:"1080px",className:"pt-20 relative",children:[(0,t.jsx)("h1",{className:"text-3xl md:text-5xl md:mt-5 text-black dark:text-white font-black text-center",children:u?"Set a new password":"Reset your password"}),(0,t.jsxs)("form",{onSubmit:e=>e.preventDefault(),className:"max-w-[500px] mx-auto py-10 border border-gray-200 shadow p-10 rounded-2xl mt-10 bg-white dark:bg-gray-800 dark:border-gray-700",children:[u?(0,t.jsx)(l.pd,{value:r?.newPassword||"",type:"password",required:!0,label:"Enter new password",autoFocus:!0,onChange:e=>s(r=>({...r,newPassword:e.target.value}))}):(0,t.jsx)(l.pd,{value:r?.email||"",type:"email",required:!0,label:"Enter your email",placeholder:"e.g [email protected]",autoFocus:!0,onChange:e=>s(r=>({...r,email:e.target.value}))}),(0,t.jsx)(l.$n,{type:"submit",onClick:u?m:x,className:"flex items-center justify-center w-full px-4 py-3 text-lg font-semibold text-white md:text-lg md:py-2 bg-linear-to-br from-red-400 to-pink-600 rounded-xl mt-3",children:u?"Set password":"Send recovery email"})]})]})]})}},23693:(e,r,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/reset-password",function(){return s(6444)}])}},e=>{e.O(0,[4558,1958,636,6593,8792],()=>e(e.s=23693)),_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.