PageSourceSearch

https://exxpress.at/assets/EditorialLogin-DEGv5uMx.js

js exxpress.at collected 2026-10-01 10:32:00 UTC 4,325 bytes, 1 lines download raw bytes

1import{r as e,j as s}from"./vendor-react-D0h46m16.js";import{a as r,L as a}from"./legacy-article-redirect-fp3isHR7.js";import{u as i,t}from"./zod-DEiz4V_m.js";import{u as o}from"./vendor-query-Dr68jqlw.js";import{u as n,s as l}from"./use-search-history-Boqjf0_n.js";import{l as d}from"./use-profile-CuRxmWYi.js";import{u as m,B as c}from"./button-CykUDgWQ.js";import{I as u}from"./use-regenerate-feed-DLitAIVb.js";import{L as h}from"./use-comment-appeals-DYtoMEP7.js";import{C as p,b as x,d as j,e as f,a as g}from"./altTextGenerator-DWCIDCE5.js";import{A as y,a as w}from"./alert-D-Nwoxg7.js";import{n as v,Q as N,E as b,d as S}from"./vendor-icons-BbYfpdOz.js";import{o as k,s as E}from"./types-JTRFwEef.js";import"./ScrollToTop-BbnbJAtN.js";import"./exports-cWTammwm.js";import"./index-DqZvI2U2.js";import"./vendor-api-B4hs_cPm.js";import"./vendor-radix-D7CZeoLk.js";import"./vendor-radix-core-BVUYVtAx.js";const A=k({email:E().email("Ungültige E-Mail-Adresse"),password:E().min(6,"Passwort muss mindestens 6 Zeichen haben")}),z=()=>{const k=r(),E=o(),{toast:z}=m(),[B,L]=e.useState(!1),[Q,q]=e.useState(!1),[M,O]=e.useState(""),{session:C,isLoading:F,isAuthenticated:I}=n(),{data:K,isLoading:P}=d(),{register:T,handleSubmit:W,formState:{errors:G}}=i({resolver:t(A)});e.useEffect(()=>{if(!F&&!P&&I&&C){["admin","redakteur","moderator"].some(e=>Array.isArray(K)&&K.includes(e))&&k("/redaktion/",{replace:!0})}},[F,P,I,C,K,k]);return s.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:s.jsxs(p,{className:"w-full max-w-md",children:[s.jsxs(x,{className:"space-y-3 text-center",children:[s.jsx("div",{className:"mx-auto w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center",children:s.jsx(v,{className:"h-6 w-6 text-primary"})}),s.jsx(j,{className:"text-2xl",children:"Editorial Office"}),s.jsx(f,{children:"Melden Sie sich an, um auf das CMS zuzugreifen"})]}),s.jsx(g,{children:s.jsxs("form",{onSubmit:W(async e=>{L(!0),O("");try{const{data:{session:s}}=await l.auth.getSession();s&&(await l.auth.signOut(),E.setQueryData(["session"],null),E.removeQueries({queryKey:["user-roles"]}));const{data:r,error:a}=await l.auth.signInWithPassword({email:e.email,password:e.password});if(a)throw a;if(E.invalidateQueries({queryKey:["user-roles"]}),E.invalidateQueries({queryKey:["session"]}),r.user){const{data:e,error:s}=await l.from("user_roles").select("role").eq("user_id",r.user.id),a=e?.map(e=>e.role)||[],i=["admin","redakteur","moderator"];if(s||!a.some(e=>i.includes(e)))return await l.auth.signOut(),void O("Sie haben keine Berechtigung für diesen Bereich. Bitte kontaktieren Sie einen Administrator.");z({title:"Erfolgreich angemeldet",description:"Willkommen im Editorial Office"}),k("/redaktion/")}}catch(s){console.error("Login error:",s);const e=s instanceof Error?s.message:"";O("Invalid login credentials"===e?"E-Mail oder Passwort ist falsch.":e||"Ein Fehler ist aufgetreten. Bitte versuchen Sie es erneut.")}finally{L(!1)}}),className:"space-y-4",children:[M&&s.jsx(y,{variant:"destructive",children:s.jsx(w,{children:M})}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(h,{htmlFor:"email",children:"E-Mail"}),s.jsx(u,{id:"email",type:"email",placeholder:"[email protected]",...T("email"),disabled:B}),G.email&&s.jsx("p",{className:"text-sm text-destructive",children:G.email.message})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(h,{htmlFor:"password",children:"Passwort"}),s.jsxs("div",{className:"relative",children:[s.jsx(u,{id:"password",type:Q?"text":"password",placeholder:"••••••••",...T("password"),disabled:B}),s.jsx(c,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3",onClick:()=>q(!Q),tabIndex:-1,children:Q?s.jsx(N,{className:"h-4 w-4"}):s.jsx(b,{className:"h-4 w-4"})})]}),G.password&&s.jsx("p",{className:"text-sm text-destructive",children:G.password.message})]}),s.jsx(c,{type:"submit",className:"w-full",disabled:B,children:B?s.jsxs(s.Fragment,{children:[s.jsx(S,{className:"mr-2 h-4 w-4 animate-spin"}),"Wird angemeldet..."]}):"Anmelden"}),s.jsx("div",{className:"text-center text-sm text-muted-foreground",children:s.jsx(a,{to:"/",className:"hover:text-foreground transition-colors",children:"Zurück zur Startseite"})})]})})]})})};export{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.