PageSourceSearch

https://lecollectif.tv/assets/sign-in-wPB28jdw.js

js lecollectif.tv collected 2026-09-30 06:37:55 UTC 2,585 bytes, 1 lines download raw bytes

1import{u as N,r as t,j as e,A as C,F as u,b as d,L as E,s as f}from"./index-r9cUOzRa.js";import{r as P}from"./post-auth-redirect-9BqJXWf3.js";import{L as b}from"./loader-circle-BJSgGe5S.js";function A(){const g=N(),[n,c]=t.useState(""),[m,w]=t.useState(""),[r,s]=t.useState(!1),[i,o]=t.useState(null),[j,p]=t.useState("signin"),[x,h]=t.useState(null);async function y(l){l.preventDefault(),o(null),s(!0);const{error:a}=await f.auth.signInWithPassword({email:n,password:m});if(a){o(a.message),s(!1);return}const v=await P();g({to:v,replace:!0})}async function S(l){l.preventDefault(),o(null),h(null),s(!0);const{error:a}=await f.auth.resetPasswordForEmail(n,{redirectTo:`${window.location.origin}/reset-password`});if(a){o(a.message),s(!1);return}h("Check your email for a password reset link."),s(!1)}return e.jsxs(C,{title:"Welcome back",subtitle:"Sign in to your dashboard.",children:[j==="signin"?e.jsxs("form",{onSubmit:y,className:"space-y-3",children:[e.jsx(u,{label:"Email",type:"email",value:n,onChange:c,required:!0}),e.jsx(u,{label:"Password",type:"password",value:m,onChange:w,required:!0}),e.jsx("div",{className:"flex justify-end",children:e.jsx("button",{type:"button",onClick:()=>p("forgot"),className:"text-xs font-semibold text-white/70 hover:text-white hover:underline",children:"Forgot password?"})}),e.jsxs("button",{type:"submit",disabled:r,className:"mt-2 flex w-full items-center justify-center gap-2 rounded-full bg-brand-gradient px-5 py-3 text-sm font-semibold text-white shadow-pop disabled:opacity-60",children:[r?e.jsx(b,{className:"size-4 animate-spin"}):null,"Sign In"]}),i?e.jsx(d,{children:i}):null]}):e.jsxs("form",{onSubmit:S,className:"space-y-3",children:[e.jsx(u,{label:"Email",type:"email",value:n,onChange:c,required:!0}),e.jsxs("button",{type:"submit",disabled:r,className:"mt-2 flex w-full items-center justify-center gap-2 rounded-full bg-brand-gradient px-5 py-3 text-sm font-semibold text-white shadow-pop disabled:opacity-60",children:[r?e.jsx(b,{className:"size-4 animate-spin"}):null,"Send reset email"]}),i?e.jsx(d,{children:i}):null,x?e.jsx(d,{tone:"info",children:x}):null,e.jsxs("p",{className:"text-center text-sm text-white/60",children:["Remember your password?"," ",e.jsx("button",{type:"button",onClick:()=>p("signin"),className:"font-semibold text-white hover:underline",children:"Sign in"})]})]}),e.jsxs("p",{className:"mt-6 text-center text-sm text-white/60",children:["Don't have an account?"," ",e.jsx(E,{to:"/sign-up",className:"font-semibold text-white hover:underline",children:"Sign up"})]})]})}export{A as component};

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.