PageSourceSearch

https://henset-9router.hf.space/_next/static/chunks/app/login/page-dc885cca61893e2a.js

js henset-9router.hf.space collected 2026-10-03 16:55:38 UTC 3,955 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4520],{15872:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>n});var a=s(73365),r=s(1521),i=s(74156),l=s(29717);function n(){let[e,t]=(0,r.useState)(""),[s,n]=(0,r.useState)(""),[d,o]=(0,r.useState)(!1),[c,x]=(0,r.useState)(null),[u,h]=(0,r.useState)("password"),[m,p]=(0,r.useState)(!1),[b,f]=(0,r.useState)("Sign in with OIDC"),w=(0,l.useRouter)();(0,r.useEffect)(()=>{!async function(){let e=new AbortController,t=setTimeout(()=>e.abort(),5e3),s=window.location.origin;try{let a=await fetch(`${s}/api/auth/status`,{signal:e.signal});if(clearTimeout(t),a.ok){let e=await a.json();if(!1===e.requireLogin){w.push("/dashboard"),w.refresh();return}x(!!e.hasPassword),h(e.authMode||"password"),p(!0===e.oidcConfigured),f(e.oidcLoginLabel||"Sign in with OIDC")}else x(!0)}catch(e){clearTimeout(t),x(!0)}}()},[w]);let g=async t=>{t.preventDefault(),o(!0),n("");try{let t=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:e})});if(t.ok)w.push("/dashboard"),w.refresh();else{let e=await t.json();n(e.error||"Invalid password")}}catch(e){n("An error occurred. Please try again.")}finally{o(!1)}},j=m&&["oidc","both"].includes(u),N="oidc"!==u||!m;return null===c?(0,a.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-bg p-4",children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-b-2 border-primary"}),(0,a.jsx)("p",{className:"text-text-muted mt-4",children:"Loading..."})]})}):(0,a.jsxs)("div",{className:"min-h-screen flex items-center justify-center bg-bg p-4 relative overflow-hidden",children:[(0,a.jsx)("div",{className:"landing-grid absolute inset-0 pointer-events-none","aria-hidden":"true"}),(0,a.jsxs)("div",{className:"relative z-10 w-full max-w-md",children:[(0,a.jsxs)("div",{className:"text-center mb-8",children:[(0,a.jsx)("h1",{className:"text-3xl font-bold text-primary mb-2",children:"9Router"}),(0,a.jsx)("p",{className:"text-text-muted",children:"oidc"===u&&m?"Sign in with your OIDC provider to access the dashboard":"Enter your password to access the dashboard"})]}),(0,a.jsx)(i.Zp,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[j&&(0,a.jsx)(i.$n,{type:"button",variant:"primary",className:"w-full",onClick:()=>{window.location.href="/api/auth/oidc/start"},children:b}),j&&N&&(0,a.jsx)("div",{className:"h-px bg-border/60"}),N?(0,a.jsxs)("form",{onSubmit:g,className:"flex flex-col gap-4",children:[("oidc"===u&&!m||"both"===u&&!m)&&(0,a.jsx)("p",{className:"text-xs text-amber-600 dark:text-amber-400 text-center",children:"OIDC login is enabled, but the issuer/client fields are not configured yet. Password login is still available for recovery."}),"both"===u&&m&&(0,a.jsx)("p",{className:"text-xs text-text-muted text-center",children:"Password and OIDC login are both enabled."}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium",children:"Password"}),(0,a.jsx)(i.pd,{type:"password",placeholder:"Enter password",value:e,onChange:e=>t(e.target.value),required:!0,autoFocus:!j}),s&&(0,a.jsx)("p",{className:"text-xs text-red-500",children:s})]}),(0,a.jsx)(i.$n,{type:"submit",variant:"primary",className:"w-full",loading:d,children:"Login"}),(0,a.jsxs)("p",{className:"text-xs text-center text-text-muted mt-2",children:["Default password is ",(0,a.jsx)("code",{className:"bg-sidebar px-1 rounded",children:"123456"})]}),!1===c&&(0,a.jsx)("p",{className:"text-xs text-center text-text-muted",children:"No custom password is set yet. The default password above will work until you change it."})]}):s&&(0,a.jsx)("p",{className:"text-xs text-red-500",children:s})]})})]})]})}},92943:(e,t,s)=>{Promise.resolve().then(s.bind(s,15872))}},e=>{e.O(0,[7848,4335,6795,505,4156,2347,5158,7358],()=>e(e.s=92943)),_N_E=e.O()}]);

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.