PageSourceSearch

https://techmalak.com/assets/js/ResetPassword-zVCyRgIM.js

js techmalak.com collected 2026-09-24 23:52:12 UTC 7,402 bytes, 1 lines download raw bytes

1import{l as u,g as P,j as e}from"./main-BGrMPGSc.js";import{u as B,c as D,a as s}from"./router-vendor-CnMLpzFH.js";import{s as m}from"./supabase-Bp7AwA7Z.js";import{P as F}from"./index-1odnOtpu.js";import{E as S}from"./eye-off-CakJd18S.js";import{E as k}from"./eye-Cla8Zm8d.js";import"./ui-vendor-mBAqIvvt.js";import"./createLucideIcon-KzH94YZI.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};a.SENTRY_RELEASE={id:"c2fa0ad612596b597e7066496a65ae647c4e0b42"};var l=new a.Error().stack;l&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[l]="43ac14db-e105-441c-b771-71e431c82183",a._sentryDebugIdIdentifier="sentry-dbid-43ac14db-e105-441c-b771-71e431c82183")}catch{}})();function A(){const a=B(),[l]=D(),[o,i]=s.useState("verifying"),[d,_]=s.useState(""),[b,C]=s.useState(""),[f,I]=s.useState(!1),[p,E]=s.useState(!1),[w,g]=s.useState(!1),[y,n]=s.useState(null),v=s.useRef(null),x=s.useRef(null);s.useEffect(()=>{const r=l.get("code");if(!r){i("invalid");return}let t=!1;return(async()=>{try{const{error:c}=await m.auth.exchangeCodeForSession(r);if(t)return;if(c){const{data:{session:T}}=await m.auth.getSession();if(t)return;T?i("ready"):(u.warn("Password reset link invalid/expired:",c.message),i("invalid"))}else i("ready")}catch(c){t||(u.error("Password reset code exchange failed:",c),i("invalid"))}})(),()=>{t=!0}},[]),s.useEffect(()=>{const r=P.context(()=>{x.current&&P.fromTo(x.current,{opacity:0,y:30},{opacity:1,y:0,duration:.8,ease:"power3.out",delay:.15})},v);return()=>r.revert()},[]);const h=async r=>{try{await m.auth.signOut()}catch{}a("/login",{replace:!0,state:r})},z=async r=>{if(r.preventDefault(),n(null),d!==b){n("Passwords do not match.");return}if(d.length<8){n("Password must be at least 8 characters.");return}g(!0);try{const{error:t}=await m.auth.updateUser({password:d});if(t){u.warn("Password update failed:",t.message),t.message.toLowerCase().includes("different from the old")?n("Your new password must be different from your current password."):t.message.toLowerCase().includes("password")?n(t.message):n("Something went wrong updating your password. Please try again.");return}await h({resetSuccess:!0})}catch(t){u.error("Password update error:",t),n("Something went wrong updating your password. Please try again.")}finally{g(!1)}},N="w-full bg-white/[0.04] border border-white/[0.08] rounded-lg px-4 py-3 text-white text-sm font-['Inter'] placeholder:text-zinc-600 focus:outline-none focus:border-brand-primary/50 focus:ring-1 focus:ring-brand-primary/30 transition-all duration-200",j="block text-tiny-plus font-medium text-zinc-500 uppercase tracking-wider mb-1.5 font-['JetBrains_Mono']",R=()=>{switch(o){case"verifying":return"Verifying your reset link…";case"invalid":return"This reset link is no longer valid";default:return"Choose a new password for your account"}};return e.jsxs("div",{ref:v,className:"fixed inset-0 bg-bg-page flex items-center justify-center overflow-hidden",style:{fontFamily:"'Inter', sans-serif"},children:[e.jsx(F,{size:"fixed"}),e.jsx("div",{className:"fixed top-0 left-0 w-full h-px bg-gradient-to-r from-transparent via-brand-primary/20 to-transparent"}),e.jsx("div",{className:"fixed bottom-0 left-0 w-full h-px bg-gradient-to-r from-transparent via-brand-accent/15 to-transparent"}),e.jsxs("div",{ref:x,className:"relative z-10 w-full max-w-md mx-4",style:{opacity:0},children:[e.jsx("div",{className:"flex justify-center mb-6",children:e.jsx("img",{src:"/larger_top_logo_icon.png",alt:"TechMalak",className:"h-16 w-auto"})}),e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("p",{className:"text-tiny tracking-[0.3em] text-zinc-600 font-['JetBrains_Mono'] uppercase mb-3",children:"Password Reset"}),e.jsx("p",{className:"text-sm text-zinc-500 font-['Inter']",children:R()})]}),e.jsxs("div",{className:"bg-black/40 backdrop-blur-xl border border-white/[0.06] rounded-2xl p-8",children:[o==="verifying"&&e.jsxs("div",{className:"py-6 text-center",role:"status",children:[e.jsx("div",{className:"inline-block w-6 h-6 border-2 border-brand-primary/40 border-t-brand-primary rounded-full animate-spin"}),e.jsx("p",{className:"mt-4 text-xs text-zinc-500 font-['Inter']",children:"Checking your reset link…"})]}),o==="invalid"&&e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"mb-6 p-3 bg-error/10 border border-error/20 rounded-lg",children:e.jsx("p",{className:"text-xs text-error font-['Inter'] leading-relaxed",children:"This password reset link is invali
1d or has expired. Reset links can only be used once and expire after a short time."})}),e.jsx("button",{type:"button",onClick:()=>{h({requestNewReset:!0})},className:"w-full py-3 px-6 rounded-lg text-sm font-semibold text-white font-['Inter'] bg-gradient-to-r from-brand-from to-brand-primary hover:shadow-[0_0_30px_color-mix(in_srgb,var(--color-brand-primary)_30%,transparent)] active:scale-[0.98] transition-all duration-200",children:"Request a New Link"})]}),o==="ready"&&e.jsxs(e.Fragment,{children:[y&&e.jsx("div",{className:"mb-6 p-3 bg-error/10 border border-error/20 rounded-lg",children:e.jsx("p",{className:"text-xs text-error font-['Inter'] leading-relaxed",children:y})}),e.jsxs("form",{onSubmit:z,className:"space-y-5",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"newPassword",className:j,children:"New Password"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:"newPassword",type:f?"text":"password",required:!0,value:d,onChange:r=>_(r.target.value),placeholder:"Min. 8 characters",className:`${N} pr-11`}),e.jsx("button",{type:"button",onClick:()=>I(!f),className:"absolute right-3 top-1/2 -translate-y-1/2 text-zinc-600 hover:text-zinc-400 transition-colors",children:f?e.jsx(S,{className:"w-4 h-4"}):e.jsx(k,{className:"w-4 h-4"})})]})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"confirmNewPassword",className:j,children:"Confirm New Password"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:"confirmNewPassword",type:p?"text":"password",required:!0,value:b,onChange:r=>C(r.target.value),placeholder:"Confirm your new password",className:`${N} pr-11`}),e.jsx("button",{type:"button",onClick:()=>E(!p),className:"absolute right-3 top-1/2 -translate-y-1/2 text-zinc-600 hover:text-zinc-400 transition-colors",children:p?e.jsx(S,{className:"w-4 h-4"}):e.jsx(k,{className:"w-4 h-4"})})]})]}),e.jsx("button",{type:"submit",disabled:w,className:"w-full py-3 px-6 rounded-lg text-sm font-semibold text-white font-['Inter'] bg-gradient-to-r from-brand-from to-brand-primary hover:shadow-[0_0_30px_color-mix(in_srgb,var(--color-brand-primary)_30%,transparent)] active:scale-[0.98] transition-all duration-200 disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:shadow-none",children:w?"Updating Password…":"Set New Password"})]})]}),e.jsx("div",{className:"mt-6 pt-5 border-t border-white/[0.06] text-center",children:e.jsxs("p",{className:"text-xs text-zinc-600 font-['Inter']",children:["Remember your password?"," ",e.jsx("button",{type:"button",onClick:()=>{h()},className:"text-brand-primary hover:text-brand-from font-medium transition-colors",children:"Back to Sign In"})]})})]}),e.jsx("p",{className:"text-center mt-6 text-tiny tracking-[0.2em] text-zinc-700 font-['JetBrains_Mono'] uppercase",children:"Crypto Intelligence Platform"})]})]})}export{A as default};

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.