PageSourceSearch

https://www.start-campus.de/assets/AlumniOwnershipVerificationPage--Q2VbrPt.js

js start-campus.de collected 2026-10-05 07:31:15 UTC 6,808 bytes, 1 lines download raw bytes

1import{az as $,a as L,b as q,r as n,j as e,aA as A,T as r,d as w,e as y,B as g,D as k,aB as P,W as B}from"./index-BnBEKW9z.js";import{K as D}from"./key-round-80pMCtdp.js";import{S as K}from"./shield-check-C7JFSweO.js";function V(){const{token:h}=$(),C=L(),{t:a}=q(),[m,l]=n.useState("loading"),[S,I]=n.useState(""),[d,E]=n.useState(""),[p,R]=n.useState(""),[x,c]=n.useState(""),[v,j]=n.useState(!1),[i,u]=n.useState({dataProtection:!1,platformContract:!1,consentedInformation:!1}),[f,T]=n.useState(!0),o=n.useId(),b=n.useRef(!1),F=i.dataProtection&&i.platformContract&&i.consentedInformation;n.useEffect(()=>{if(b.current)return;b.current=!0,(async()=>{try{const s=await P.verifyOwnership(h);(s==null?void 0:s.status)==="verified"&&(s!=null&&s.email)?(I(s.email),l("password")):l("error")}catch{l("error")}})()},[h]);const N=()=>{if(c(""),!d||d.length<8){c(a("alumni.register.ownershipPage.errorMinLength"));return}if(d!==p){c(a("alumni.register.ownershipPage.errorMismatch"));return}l("consent")},z=async()=>{c(""),j(!0);try{const t=await P.completeOwnership({email:S,password:d,password_confirmation:p,token:h});(t==null?void 0:t.status)==="approved"&&(t!=null&&t.bearerToken)?await B.getUser(t.bearerToken)&&C("/alumni-onboarding",{replace:!0}):c(a("vocab.asyncError"))}catch{c(a("vocab.asyncError"))}finally{j(!1)}};return e.jsx("div",{className:"flex min-h-screen items-center justify-center px-4",children:e.jsxs("div",{className:"w-full max-w-2xl rounded-lg border bg-white p-8 shadow-sm",children:[m==="loading"&&e.jsxs("div",{className:"text-center",children:[e.jsx(A,{size:44,className:"mx-auto mb-4"}),e.jsx(r,{variant:"h3",children:a("alumni.register.ownershipPage.verifying")})]}),m==="error"&&e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-red-100 text-3xl",children:"⚠️"}),e.jsx(r,{variant:"h3",className:"mb-2",children:a("alumni.register.ownershipPage.linkInvalid")}),e.jsx(r,{variant:"p",className:"text-muted-foreground",children:a("alumni.register.ownershipPage.linkExpired")})]}),m==="password"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-6 flex flex-col items-center gap-2",children:[e.jsx("div",{className:"rounded-full bg-primary/10 p-4",children:e.jsx(D,{className:"h-8 w-8 text-primary"})}),e.jsx(r,{variant:"h3",className:"text-center",children:a("alumni.register.ownershipPage.title")}),e.jsx(r,{variant:"p2",className:"text-center text-muted-foreground",children:a("alumni.register.ownershipPage.description")})]}),e.jsx(w,{label:a("alumni.register.ownershipPage.passwordLabel"),containerClassName:"py-1 flex flex-col",children:e.jsx(y,{type:"password",placeholder:a("alumni.register.ownershipPage.passwordPlaceholder"),value:d,isInputField:!0,onChange:t=>E(t.target.value)})}),e.jsx(w,{label:a("alumni.register.ownershipPage.confirmLabel"),containerClassName:"py-1 flex flex-col",children:e.jsx(y,{type:"password",placeholder:a("alumni.register.ownershipPage.confirmPlaceholder"),value:p,isInputField:!0,onChange:t=>R(t.target.value),onKeyDown:t=>{t.key==="Enter"&&(t.preventDefault(),N())}})}),x&&e.jsx("div",{className:"mt-4 rounded-md border border-red-200 bg-red-50 p-3",children:e.jsx(r,{variant:"p2",className:"text-red-800",children:x})}),e.jsx(g,{variant:"primary",className:"mt-6 w-full",onClick:N,children:a("alumni.checkup.nav.next")})]}),m==="consent"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-6 flex flex-col items-center gap-2",children:[e.jsx("div",{className:"rounded-full bg-primary/10 p-4",children:e.jsx(K,{className:"h-8 w-8 text-primary"})}),e.jsx(r,{variant:"h3",className:"text-center",children:a("alumni.register.consent.title")})]}),e.jsxs("div",{className:"mb-6 rounded-md border bg-accent/50 p-5",children:[e.jsx(r,{variant:"p2",className:"mb-4 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:a("alumni.register.consent.subtitle")}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsxs("label",{htmlFor:`${o}-dataProtection`,className:"flex flex-1 cursor-pointer flex-col",children:[e.jsx(r,{variant:"p2",children:a("auth.register.dataProtection")}),e.jsx(k,{to:"/datenschutz",target:"_blank",rel:"noopener noreferrer",className:"text-sm font-medium text-primary hover:underline",children:a("userRegistration.dataProtection")})]}),e.jsxs("div",{className:"flex shrink-0 flex-col items-center gap-1",children:[e.jsx("input",{id:`${o}-dataProtection`,type:"checkbox",checked:i.dataProtection,onChange:t=>u(s=>({...s,dataProtection:t.target.checked})),className:"h-5 w-5 accent-primary"}),f&&!i.dataProtection&&e.jsx(r,{variant:"p2",className:"text-xs italic text-primary",children:a("vocab.fieldRequired")})]})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsxs("label",{htmlFor:`${o}-platformContract`,className:"flex flex-1 cursor-pointer flex-col",children:[e.jsx(r,{variant:"p2",children:a("auth.register.platformContract")}
1),e.jsx(k,{to:"https://start-campus.s3.eu-central-1.amazonaws.com/files2/Plattformvertrag.pdf",target:"_blank",rel:"noopener noreferrer",className:"text-sm font-medium text-primary hover:underline",children:a("userRegistration.platformAgreement")})]}),e.jsxs("div",{className:"flex shrink-0 flex-col items-center gap-1",children:[e.jsx("input",{id:`${o}-platformContract`,type:"checkbox",checked:i.platformContract,onChange:t=>u(s=>({...s,platformContract:t.target.checked})),className:"h-5 w-5 accent-primary"}),f&&!i.platformContract&&e.jsx(r,{variant:"p2",className:"text-xs italic text-primary",children:a("vocab.fieldRequired")})]})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("label",{htmlFor:`${o}-consentedInformation`,className:"flex-1 cursor-pointer",children:e.jsx(r,{variant:"p2",children:a("auth.register.consentedInformation")})}),e.jsxs("div",{className:"flex shrink-0 flex-col items-center gap-1",children:[e.jsx("input",{id:`${o}-consentedInformation`,type:"checkbox",checked:i.consentedInformation,onChange:t=>u(s=>({...s,consentedInformation:t.target.checked})),className:"h-5 w-5 accent-primary"}),f&&!i.consentedInformation&&e.jsx(r,{variant:"p2",className:"text-xs italic text-primary",children:a("vocab.fieldRequired")})]})]})]})]}),x&&e.jsx("div",{className:"mt-4 rounded-md border border-red-200 bg-red-50 p-3",children:e.jsx(r,{variant:"p2",className:"text-red-800",children:x})}),e.jsxs("div",{className:"mt-6 flex items-center justify-between",children:[e.jsx(g,{size:"sm",variant:"ghost",onClick:()=>{l("password"),c("")},children:a("alumni.checkup.nav.back")}),e.jsx(g,{size:"sm",variant:"primary",disabled:v,loading:v,onClick:()=>{T(!0),F&&z()},children:a("alumni.register.ownershipPage.submit")})]})]})]})})}export{V 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.