PageSourceSearch

https://it-brauhaus.com/assets/PasswordRequestPage-BB8zqMhQ.js

js it-brauhaus.com collected 2026-10-07 05:17:45 UTC 9,335 bytes, 1 lines download raw bytes

1import{aJ as M,r as s,w as V,j as e,H as F,x as k,ab as u,L as O,ac as S,a3 as E,F as q}from"./index-B3DE65hq.js";import{S as G}from"./shield-check-DJu9EXcH.js";import{C as H}from"./check-gEScpMbC.js";function _(o){const r=o.replace(/-/g,"+").replace(/_/g,"/"),a=r+"=".repeat((4-r.length%4)%4),l=atob(a),d=new Uint8Array(l.length);for(let n=0;n<l.length;n+=1)d[n]=l.charCodeAt(n);return d}function b(o){let r="";return o.forEach(a=>{r+=String.fromCharCode(a)}),btoa(r)}function Z(){const r=M().token??"",[a,l]=s.useState(null),[d,n]=s.useState(""),[i,A]=s.useState(!0),[c,C]=s.useState(""),[h,B]=s.useState(""),[p,P]=s.useState(""),[g,z]=s.useState(""),[x,w]=s.useState(!1),[f,v]=s.useState(""),[j,K]=s.useState(!1);s.useEffect(()=>{V({title:"Passwort sicher übermitteln | IT Brauhaus",description:"Senden Sie Ihr Passwort Ende-zu-Ende-verschlüsselt an IT Brauhaus.",path:`/passwort-anfrage/${r}`,noIndex:!0})},[r]),s.useEffect(()=>{(async()=>{try{const t=await fetch(`/api/public/password-requests/${encodeURIComponent(r)}`),m=await t.json().catch(()=>null);if(!t.ok)throw new Error(m?.message??"Anfrage konnte nicht geladen werden.");l(m)}catch(t){n(t instanceof Error?t.message:"Anfrage konnte nicht geladen werden.")}finally{A(!1)}})()},[r]);const I=async()=>{if(!(!c.trim()||!a?.publicKey)){w(!0),v("");try{if(!window.crypto?.subtle)throw new Error("Ihr Browser unterstützt keine sichere Verschlüsselung. Bitte nutzen Sie einen aktuellen Browser.");const t=await window.crypto.subtle.generateKey({name:"AES-GCM",length:256},!0,["encrypt"]),m=new Uint8Array(await window.crypto.subtle.exportKey("raw",t)),N=window.crypto.getRandomValues(new Uint8Array(12)),L=JSON.stringify({password:c.trim(),username:h.trim(),label:p.trim(),note:g.trim()}),R=new Uint8Array(await window.crypto.subtle.encrypt({name:"AES-GCM",iv:N},t,new TextEncoder().encode(L))),U=await window.crypto.subtle.importKey("spki",_(a.publicKey),{name:"RSA-OAEP",hash:"SHA-256"},!1,["encrypt"]),D=new Uint8Array(await window.crypto.subtle.encrypt({name:"RSA-OAEP"},U,m)),y=await fetch(`/api/public/password-requests/${encodeURIComponent(r)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ciphertext:b(R),iv:b(N),wrappedKey:b(D)})}),T=await y.json().catch(()=>null);if(!y.ok)throw new Error(T?.message??"Übermittlung fehlgeschlagen.");K(!0)}catch(t){v(t instanceof Error?t.message:"Übermittlung fehlgeschlagen.")}finally{w(!1)}}};return e.jsxs("div",{className:"min-h-screen bg-[var(--brand-surface)]",children:[e.jsx(F,{}),e.jsx("main",{className:"mx-auto flex min-h-[70vh] w-full max-w-2xl flex-col justify-center px-5 py-20 md:px-6",children:e.jsxs("div",{className:"rounded-3xl border border-[var(--brand-border)] bg-white p-8 shadow-[0_20px_60px_rgba(0,22,51,0.08)] md:p-10",children:[i&&e.jsxs("div",{className:"text-center",children:[e.jsx(k,{className:"mx-auto h-8 w-8 animate-spin text-[var(--brand-gold)]"}),e.jsx("p",{className:"mt-4 text-sm font-semibold text-[var(--brand-dark)]",children:"Anfrage wird geladen…"})]}),!i&&d&&e.jsxs("div",{className:"text-center",children:[e.jsx(u,{className:"mx-auto h-8 w-8 text-red-600"}),e.jsx("h1",{className:"mt-4 font-display text-xl font-black text-[var(--brand-dark)]",children:"Anfrage nicht verfügbar"}),e.jsx("p",{className:"mt-3 text-sm text-[var(--brand-muted)]",children:d}),e.jsx("div",{className:"mt-6",children:e.jsxs(O,{href:"/tools/passwort",className:"inline-flex items-center gap-2 rounded-xl border border-[var(--brand-border)] bg-white px-5 py-3 text-sm font-bold text-[var(--brand-dark)] transition hover:border-[var(--brand-gold)]",children:[e.jsx(S,{className:"h-4 w-4"})," Stattdessen selbst Passwort senden"]})})]}),!i&&a&&a.status!=="open"&&e.jsxs("div",{className:"text-center",children:[e.jsx(u,{className:"mx-auto h-8 w-8 text-amber-500"}),e.jsx("h1",{className:"mt-4 font-display text-xl font-black text-[var(--brand-dark)]",children:a.status==="used"?"Bereits übermittelt":"Anfrage abgelaufen"}),e.jsx("p",{className:"mt-3 text-sm text-[var(--brand-muted)]",children:a.status==="used"?"Für diese Anfrage wurde bereits ein Passwort übermittelt. Vielen Dank!":"Diese Anfrage ist leider abgelaufen. Bitte wenden Sie sich an uns, damit wir einen neuen Link senden."})]}),!i&&a&&a.status==="open"&&!j&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"flex h-12 w-12 items-center justify-center rounded-2xl bg-[var(--brand-dark)]",children:e.jsx(S,{className:"h-6 w-6 text-[var(--brand-gold)]"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-black uppercase tracking-[0.18em] text-[var(--brand-gold)]",children:"Sichere Passwort-Übermittlung"}),e.jsx("h1",{className:"font-display text-xl font-black text-[var(--brand-dark)] md:text-2xl",children:a.customerName?`Hallo ${a.customerName},`:"Guten Tag,"})]})]}),e.jsxs("p",{className:"mt-4 text-sm leading-relaxed text-[var(--brand-muted)]",children:["wir benötigen ein Passwort von Ihnen. Bitte senden Sie es ",e.jsx("strong",{className:"text-[var(--brand-dark)]",children:"niemals per einfacher E-Mail"})," – nutzen Sie dieses Formular. Die Übermittlung ist ",e.jsx("strong",{className:"text-[var(--brand-dark)]",children:"Ende-zu-Ende-verschlüsselt"})," und für uns ",e.jsx("strong",{className:"text-[var(--brand-dark)]",children:"48 Stunden"})," einsehbar, danach wird sie automatisch ungültig."]}),e.jsxs("div",{className:"mt-6 grid gap-4",children:[e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"text-xs font-bold uppercase tracking-wide text-[var(--brand-muted)]",children:"Passwort *"}),e.jsx("input",{type:"password",value:c,onChange:t=>C(t.target.value),placeholder:"Das Passwort, das Sie uns senden möchten",autoComplete:"off",className:"mt-1.5 w-full rounded-xl border border-[var(--brand-border)] bg-white px-4 py-3.5 text-sm font-semibold text-[var(--brand-dark)] outline-none focus:border-[var(--brand-gold)]"})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"text-xs font-bold uppercase tracking-wide text-[var(--brand-muted)]",children:"Benutzername / E-Mail (optional)"}),e.jsx("input",{value:h,onChange:t=>B(t.target.value),placeholder:"z. B. [email protected]",autoComplete:"off",className:"mt-1.5 w-full rounded-xl border border-[var(--brand-border)] bg-white px-4 py-3.5 text-sm font-semibold text-[var(--brand-dark)] outline-none focus:border-[var(--brand-gold)]"})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"text-xs font-bold uppercase tracking-wide text-[var(--brand-muted)]",children:"Wofür ist das Passwort? (optional)"}),e.jsx("input",{value:p,onChange:t=>P(t.target.value),placeholder:"z. B. Serverzugang, E-Mail-Konto",autoComplete:"off",className:"mt-1.5 w-full rounded-xl border border-[var(--brand-border)] bg-white px-4 py-3.5 text-sm font-semibold text-[var(--brand-dark)] outline-none focus:border-[var(--brand-gold)]"})]})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"text-xs font-bold uppercase tracking-wide text-[var(--brand-muted)]",children:"Nachricht (optional)"}),e.jsx("textarea",{value:g,onChange:t=>z(t.target.value),rows:3,placeholder:"z. B. Zugang bitte nach Einrichtung wieder ändern.",className:"mt-1.5 w-full rounded-xl border border-[var(--brand-border)] bg-white px-4 py-3.5 text-sm text-[var(--brand-dark)] outline-none focus:border-[var(--brand-gold)]"})]})]}),f&&e.jsxs("p",{className:"mt-5 flex items-start gap-2 rounded-xl border border-red-200 bg-red-50 p-4 text-sm font-semibold text-red-700",children:[e.jsx(u,{className:"mt-0.5 h-4 w-4 shrink-0"})," ",f]}),e.jsxs("button",{onClick:I,disabled:x||!c.trim(),className:"mt-6 inline-flex w-full items-center justify-center gap-2 rounded-xl bg-[var(--brand-dark)] px-6 py-4 text-sm font-bold text-white transition hover:bg-[#12376B] disabled:opacity-50",children:[x?e.jsx(k,{className:"h-4 w-4 animate-spin"}):e.jsx(E,{className:"h-4 w-4"}),x?"Wird verschlüsselt & gesendet…":"Verschlüsselt senden"]}),e.jsxs("div",{className:"mt-5 grid gap-3 rounded-2xl bg-[var(--brand-surface)] p-5 text-xs text-[var(--brand-muted)] sm:grid-cols-2",children:[e.jsxs("p",{className:"flex items-start gap-2",children:[e.jsx(G,{className:"mt-0.5 h-4 w-4 shrink-0 text-[var(--brand-gold)]"})," Verschlüsselung im Browser (AES-256-GCM)."]}),e.jsxs("p",{className:"flex items-start gap-2",children:[e.jsx(E,{className:"mt-0.5 h-4 w-4 shrink-0 text-[var(--brand-gold)]"})," Nur wir können es lesen – und nur 48 Stunden lang."]})]})]}),j&&e.jsxs("div",{className:"text-center",children:[e.jsx("span",{className:"mx-auto flex h-14 w-14 items-center justify-center rounded-2xl bg-green-100",children:e.jsx(H,{className:"h-7 w-7 text-green-700"})}),e.jsx("h1",{className:"mt-5 font-display text-2xl font-black text-[var(--brand-dark)]",children:"Sicher übermittelt"}),e.jsxs("p",{className:"mt-3 text-sm leading-relaxed text-[var(--brand-muted)]",children:["Vielen Dank! Ihre Daten wurden Ende-zu-Ende-verschlüsselt übermittelt. Wir können sie jetzt ",e.jsx("strong",{className:"text-[var(--brand-dark)]",children:"48 Stunden"})," lang einsehen – danach werden sie automatisch ungültig und gelöscht."]})]})]})}),e.jsx(q,{})]})}
1export{Z 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.