# Conflicts: # hifi/assets/AccountSettings-3Az7PIEf.js # hifi/assets/AccountSettings-C7P_TaTL.js # hifi/assets/AccountSettings-CfY49TlQ.js # hifi/assets/AdminUsers-C1zi3a_m.js # hifi/assets/Brands-V9s4vz2i.js # hifi/assets/ContactRequests-BcF_HxL3.js # hifi/assets/Dashboard-m6lX2kWI.js # hifi/assets/DatabaseSettings-pQejbEjR.js # hifi/assets/Downloads-DCZm2dP9.js # hifi/assets/EmailSettings-B_RqPmc9.js # hifi/assets/EmailSettings-DixrL0D8.js # hifi/assets/EmailSettings-VadOa5J3.js # hifi/assets/ExportImportSettings-Bkwm__tE.js # hifi/assets/Faqs-CDIDxeRo.js # hifi/assets/GalleryBrands-CeGo7QXi.js # hifi/assets/GalleryPhotos-NPKQDZMi.js # hifi/assets/GalleryProjects-CfB-fA4x.js # hifi/assets/HomeSections-BzNKNMho.js # hifi/assets/ImageUploadField-B8P2oQZ9.js # hifi/assets/ImageUploadField-DyLcJG5-.js # hifi/assets/ImageUploadField-oqjVVSSG.js # hifi/assets/LegalSettings-BnY85Lz7.js # hifi/assets/LegalSettings-CRgpL0dP.js # hifi/assets/LegalSettings-DGN-Kl_a.js # hifi/assets/Login-CFL8bhtC.js # hifi/assets/Login-Dc1nFqtx.js # hifi/assets/Login-pbnF9xt-.js # hifi/assets/MaintenanceSettings-CFGyPBuq.js # hifi/assets/MaintenanceSettings-DhcTJBUJ.js # hifi/assets/MaintenanceSettings-DsGBefLo.js # hifi/assets/Models-CyjYxQOO.js # hifi/assets/Packages-6JjKaOj1.js # hifi/assets/Partners-BRwobp6H.js # hifi/assets/PermissionGroups-CW64DGq9.js # hifi/assets/PermissionGroups-DI5xJ6TD.js # hifi/assets/PermissionGroups-_i9KMBTo.js # hifi/assets/ResetSettings-Bm64tgsK.js # hifi/assets/RichTextEditor-DJwdsoJ6.js # hifi/assets/RichTextEditor-DTscIhNf.js # hifi/assets/RichTextEditor-DcSNZ4jD.js # hifi/assets/Services-BTvu0ymy.js # hifi/assets/SettingsLayout-C5JQlIqD.js # hifi/assets/SetupWizard-BHY_FJd_.js # hifi/assets/SetupWizard-Cu-s4Wuc.js # hifi/assets/SetupWizard-DcHkEIZ7.js # hifi/assets/TextStyleWidget-BZdrb1Dr.js # hifi/assets/TextStyleWidget-CkwixV2h.js # hifi/assets/TextStyleWidget-Czb7ujSZ.js # hifi/assets/UpdateSettings-Ce5oqncR.js # hifi/assets/WebsiteSettings-B7CzBT2R.js # hifi/assets/eye-CZFeBsZS.js # hifi/assets/eye-YlN_9rkm.js # hifi/assets/eye-jJN30JHV.js # hifi/assets/iconRegistry-BJRytynd.js # hifi/assets/iconRegistry-C8CVLtUq.js # hifi/assets/iconRegistry-DUWamfSa.js # hifi/assets/index-QV-Szw5n.js # hifi/assets/trash-2-CQGOvKRj.js # hifi/assets/trash-2-CwY7wd8m.js # hifi/assets/trash-2-fu7u5OTF.js # hifi/index.html
1 line
3.7 KiB
JavaScript
1 line
3.7 KiB
JavaScript
import{h as N,i as v,r,j as e,k as y,l as C,m as S}from"./index-Tg8iNBwT.js";function P(){const{user:x,login:h,verifyTwoFactor:g}=N(),o=v(),[f,u]=r.useState("credentials"),[i,p]=r.useState(""),[c,w]=r.useState(""),[m,b]=r.useState(""),[s,a]=r.useState(""),[n,l]=r.useState(!1);if(x)return e.jsx(y,{to:"/admin",replace:!0});const k=async t=>{t.preventDefault(),l(!0),a("");try{(await h(i,c)).requires2fa?u("code"):o("/admin")}catch(d){a(d.message)}finally{l(!1)}},j=async t=>{t.preventDefault(),l(!0),a("");try{await g(m),o("/admin")}catch(d){a(d.message)}finally{l(!1)}};return e.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-neutral-50 px-4 dark:bg-neutral-950",children:[e.jsx("img",{src:C,alt:"HifiPlanet",className:"h-16 w-auto dark:hidden sm:h-20"}),e.jsx("img",{src:S,alt:"HifiPlanet",className:"hidden h-16 w-auto dark:block sm:h-20"}),f==="credentials"?e.jsxs("form",{onSubmit:k,className:"w-full max-w-sm rounded-xl border border-neutral-200 bg-white p-8 shadow-sm dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h1",{className:"mb-6 text-xl font-bold text-neutral-900 dark:text-white",children:"Admin-Login"}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Benutzername"}),e.jsx("input",{value:i,onChange:t=>p(t.target.value),required:!0,autoFocus:!0,className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm focus:border-brand-500 focus:outline-none dark:border-neutral-700 dark:bg-neutral-900"})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Passwort"}),e.jsx("input",{type:"password",value:c,onChange:t=>w(t.target.value),required:!0,className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm focus:border-brand-500 focus:outline-none dark:border-neutral-700 dark:bg-neutral-900"})]}),s&&e.jsx("p",{className:"mb-4 text-sm text-red-600",children:s}),e.jsx("button",{type:"submit",disabled:n,className:"w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:n?"Anmelden…":"Anmelden"})]}):e.jsxs("form",{onSubmit:j,className:"w-full max-w-sm rounded-xl border border-neutral-200 bg-white p-8 shadow-sm dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Bestätigungscode"}),e.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:"Öffne die Google Authenticator App und gib den 6-stelligen Code ein. Alternativ kannst du auch einen deiner Wiederherstellungscodes verwenden."}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Code"}),e.jsx("input",{value:m,onChange:t=>b(t.target.value),required:!0,autoFocus:!0,inputMode:"numeric",placeholder:"123456",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-center text-lg tracking-widest focus:border-brand-500 focus:outline-none dark:border-neutral-700 dark:bg-neutral-900"})]}),s&&e.jsx("p",{className:"mb-4 text-sm text-red-600",children:s}),e.jsx("button",{type:"submit",disabled:n,className:"w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:n?"Prüfe…":"Bestätigen"}),e.jsx("button",{type:"button",onClick:()=>{u("credentials"),b(""),a("")},className:"mt-3 w-full text-sm text-neutral-500 hover:underline dark:text-neutral-400",children:"Zurück zum Login"})]})]})}export{P as default};
|