mirror of
https://github.com/luxfi/login.git
synced 2026-10-30 16:20:56 +00:00
1.7 KiB
1.7 KiB
Lux Login
Overview
Lux Network sign-in UI (login, signup, forgot password, OAuth callback) backed
by Lux IAM at https://lux.id. The primary flow now redirects users directly
to lux.id; this service still builds a Vite 8 + React 19 SPA for embeddable
/ self-hosted deployments.
Tech Stack
- Runtime: Vite 8 + React 19 (SPA)
- Router: wouter
- Styling: pure CSS (Basel Grotesk, matches lux.cloud dark theme)
- Container:
ghcr.io/hanzoai/spa(servesdist/as SPA)
Build & Run
pnpm install
pnpm dev # vite dev server on :3000
pnpm build # typecheck + vite build -> dist/
pnpm typecheck
Structure
login/
Dockerfile # build stage + ghcr.io/hanzoai/spa
index.html
package.json
src/
main.tsx
App.tsx # wouter routes: /, /login, /signup, /forgot, /callback
styles.css
components/
LuxWordmark.tsx
lib/
iam.ts # browser client for lux.id (Casdoor API + OAuth)
pages/
LoginPage.tsx
SignupPage.tsx
ForgotPage.tsx
CallbackPage.tsx
tsconfig.json
vite.config.ts
Env
Copy .env.example. All variables are VITE_* (injected at build time):
VITE_IAM_URLdefaulthttps://lux.idVITE_IAM_CLIENT_IDOAuth client IDVITE_IAM_ORGCasdoor organization (lux)VITE_IAM_APPCasdoor application (app-lux)VITE_REDIRECT_URLpost-login redirect target
Auth flow
- Password login/signup: browser
POSTto${VITE_IAM_URL}/api/login|signupagainst lux.id (Casdoor). Requires lux.id to allow CORS from the hosting origin. - OAuth fallback:
getOAuthAuthorizeUrl()redirects to${VITE_IAM_URL}/oauth/authorize; the/callbackpage exchanges the code.