PageSourceSearch

https://hintermoos.at/assets/ResetPassword-B0iqobwO.js

js hintermoos.at collected 2026-10-09 22:01:42 UTC 7,905 bytes, 1 lines download raw bytes

1import{r as t,a as A,t as B,u as D,l as U,s as g,j as e,L as I,m as N,B as _,v as H}from"./index-MoAbC8_9.js";import{h as X}from"./house-login-DLa1j6M3.js";import{M as Y}from"./mountain-BHfTfCFy.js";import{L as b}from"./lock-BEcuk4Jx.js";import{C as Q}from"./circle-check-big-_JLEBINb.js";import{E as W}from"./eye-off-D1RUMkPr.js";import{E as Z}from"./eye-DKrvAixa.js";const K=async c=>{try{const r=navigator.userAgent,l=H(r),y=/Mobile|Android|iPhone|iPad/i.test(r),n=r.match(/(Chrome|Firefox|Safari|Edge|Opera|OPR)\/[\d.]+/),d=r.match(/(Windows NT|Mac OS X|Linux|Android|iOS)[\s/]?[\d._]*/);await fetch("https://wasldznewicttoslpmnx.supabase.co/functions/v1/track-login",{method:"POST",headers:{"Content-Type":"application/json",apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Indhc2xkem5ld2ljdHRvc2xwbW54Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njc2MDcyNzgsImV4cCI6MjA4MzE4MzI3OH0.FE0Nk3VJ2ibEoUW3QEL3joKY1pM0TQhXZSygVQyuyvY"},body:JSON.stringify({user_agent:r,browser:(n==null?void 0:n[0])||"unknown",os:(d==null?void 0:d[0])||"unknown",device_type:y?"mobile":"desktop",login_method:"recovery",bot_score:l.score,bot_detection_reason:l.reason,is_suspected_bot:l.score>50,is_recovery_session:!0,status:"failed",failure_reason:c||"invalid_recovery_token"})})}catch(r){console.warn("Failed to track failed recovery:",r)}},re=()=>{const[c,r]=t.useState(""),[l,y]=t.useState(""),[n,d]=t.useState(!1),[k,S]=t.useState(!1),[j,E]=t.useState(!1),[m,w]=t.useState({}),[L,u]=t.useState(!1),[T,v]=t.useState(!0),[O,x]=t.useState(!1),[P,h]=t.useState(!1),R=A(),{toast:M}=B(),{t:s}=D(),[p]=U();t.useEffect(()=>{const a=p.get("token_hash"),i=p.get("type");if(a&&i==="recovery"){x(!0),v(!1);return}const o=async()=>{const{data:{session:f}}=await g.auth.getSession();f&&u(!0),v(!1)},{data:{subscription:V}}=g.auth.onAuthStateChange(f=>{(f==="PASSWORD_RECOVERY"||f==="SIGNED_IN")&&(u(!0),v(!1))});return setTimeout(o,500),()=>V.unsubscribe()},[p]);const z=async()=>{const a=p.get("token_hash");if(a){h(!0);try{const{data:i,error:o}=await g.auth.verifyOtp({token_hash:a,type:"recovery"});if(o||!i.session){console.error("Recovery token verification failed:",o==null?void 0:o.message),K((o==null?void 0:o.message)||"invalid_token"),x(!1),u(!1),h(!1);return}x(!1),u(!0),h(!1)}catch(i){console.error("Recovery verification error:",i),x(!1),u(!1),h(!1)}}},F=async a=>{if(a.preventDefault(),w({}),c.length<6){w({password:s("auth.passwordMinLength")});return}if(c!==l){w({confirmPassword:s("auth.passwordsDoNotMatch")});return}d(!0);const{error:i}=await g.auth.updateUser({password:c});d(!1),i?M({variant:"destructive",title:s("auth.resetPasswordTitle"),description:i.message}):(S(!0),setTimeout(()=>R("/login",{replace:!0}),3e3))},C="w-full h-12 pl-10 pr-12 rounded-lg bg-white/70 text-foreground placeholder:text-muted-foreground/50 focus:outline-none focus:ring-2 focus:ring-primary/30 backdrop-blur-sm border border-border",J=()=>T?e.jsxs("div",{className:"text-center space-y-4",children:[e.jsx(N,{className:"h-12 w-12 mx-auto text-primary animate-spin"}),e.jsx("p",{className:"text-muted-foreground",children:s("auth.verifying")})]}):O?e.jsxs("div",{className:"text-center space-y-6",children:[e.jsx("div",{className:"mx-auto h-16 w-16 rounded-full bg-primary/10 flex items-center justify-center",children:e.jsx(b,{className:"h-8 w-8 text-primary"})}),e.jsx("h2",{className:"text-2xl font-bold text-foreground",children:s("auth.resetPasswordTitle")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("auth.clickToContinueReset")}),e.jsx(_,{onClick:z,disabled:P,className:"w-full h-12 rounded-lg text-base font-semibold bg-primary hover:bg-primary/90 text-primary-foreground shadow-md",children:P?e.jsxs(e.Fragment,{children:[e.jsx(N,{className:"mr-2 h-4 w-4 animate-spin"}),s("auth.verifying")]}):s("auth.continueToReset")})]}):L?k?e.jsxs("div",{className:"text-center space-y-6",children:[e.jsx(Q,{className:"h-16 w-16 mx-auto text-primary"}),e.jsx("h2",{className:"text-2xl font-bold text-foreground",children:s("auth.passwordUpdated")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("auth.redirectingToLogin")})]}):e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"text-3xl font-bold text-foreground mb-2",children:s("auth.resetPasswordTitle")}),e.jsx("p",{className:"text-sm mb-8 text-muted-foreground",children:s("auth.resetPasswordDescription")}),e.jsxs("form",{onSubmit:F,className:"space-y-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-semibold text-primary",children:s("auth.newPassword")}),e.jsxs("div",{className:"relative",children:[e.jsx(b,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-accent z-10 pointer-events-none"}),e.jsx("input",{type:j?"text":"password",placeholder:"••••••••",value:c,onChange:a=>r(a.target.value),disabled:n,className:C}),e.jsx("button",{type:"button",onClick:()=>E(!j),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:j?e.jsx(W,{className:"h-4 w-4"}):e.jsx(Z,{className:"h-4 w-4"})})]}),m.password&&e.jsx("p",{className:"text-sm text-destructive",children:m.password})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-semibold text-primary",children:s("auth.confirmPassword")}),e.jsxs("div",{className:"relative",children:[e.jsx(b,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-accent z-10 pointer-events-none"}),e.jsx("input",{type:"password",placeholder:"••••••••",value:l,onCh
1ange:a=>y(a.target.value),disabled:n,className:C})]}),m.confirmPassword&&e.jsx("p",{className:"text-sm text-destructive",children:m.confirmPassword})]}),e.jsx(_,{type:"submit",className:"w-full h-12 rounded-lg text-base font-semibold bg-primary hover:bg-primary/90 text-primary-foreground shadow-md",disabled:n,children:n?e.jsxs(e.Fragment,{children:[e.jsx(N,{className:"mr-2 h-4 w-4 animate-spin"}),s("auth.resetPasswordTitle"),"..."]}):s("auth.resetPasswordTitle")})]})]}):e.jsxs("div",{className:"text-center space-y-6",children:[e.jsx("div",{className:"mx-auto h-16 w-16 rounded-full bg-amber-100 flex items-center justify-center",children:e.jsx(b,{className:"h-8 w-8 text-amber-600"})}),e.jsx("h2",{className:"text-2xl font-bold text-foreground",children:s("auth.invalidLink")}),e.jsxs("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-4 text-left space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-amber-800",children:s("auth.resetLinkExpiredTitle")}),e.jsx("p",{className:"text-sm text-amber-700",children:s("auth.resetLinkExpired")}),e.jsx("p",{className:"text-sm text-amber-700",children:s("auth.resetLinkSuperseded")})]}),e.jsx(I,{to:"/login?forgot=1",className:"inline-flex items-center gap-2 text-sm font-medium underline text-primary hover:text-primary/80",children:s("auth.requestNewLink")})]});return e.jsxs("div",{className:"min-h-screen relative flex items-center justify-center",children:[e.jsx("div",{className:"absolute inset-0 bg-cover bg-center",style:{backgroundImage:`url(${X})`}}),e.jsx("div",{className:"absolute inset-0 bg-white/80"}),e.jsxs("div",{className:"relative z-10 w-full max-w-lg px-8 py-12",children:[e.jsxs(I,{to:"/",className:"flex items-center justify-center gap-3 mb-6 group",children:[e.jsx(Y,{className:"h-8 w-8 text-primary group-hover:scale-110 transition-transform"}),e.jsxs("div",{className:"flex flex-col leading-tight",children:[e.jsx("span",{className:"font-serif text-[10px] tracking-[0.2em] uppercase text-muted-foreground",children:"Appartementhaus"}),e.jsx("span",{className:"font-serif text-xl text-foreground group-hover:text-primary transition-colors",children:"Hintermoos"})]})]}),e.jsx("div",{className:"bg-white/95 backdrop-blur-sm rounded-xl shadow-lg border border-border/50 px-8 py-10",children:J()})]})]})};export{re 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.