Commit Graph

2 Commits

Author SHA1 Message Date
kovakmedya d8b61b7da8 fix(auth): move initialAuthState/AuthState to auth-types.ts
Server-action files ('use server') can only export async functions.
Exporting initialAuthState (object) caused:
  'A use server file can only export async functions, found object'
when sign-up form was submitted.

Moved AuthState type and initialAuthState const to lib/appwrite/auth-types.ts.
Updated 3 form components to import the const from the new location.
2026-04-30 03:08:26 +03:00
kovakmedya dfa1b28632 feat(auth): Appwrite-backed sign-in / sign-up / forgot-password + middleware guard
- Server actions in lib/appwrite/auth-actions.ts:
  signInAction, signUpAction, forgotPasswordAction, signOutAction
  All use node-appwrite admin client; session secret stored as httpOnly
  cookie (isletmem-session). Errors localized to Turkish.
- Redesigned /sign-in and /sign-up using sign-in-3 split-card layout,
  branded as 'İşletmem' with gradient brand panel (no external image).
  Removed social login buttons (email/password only for now).
- /forgot-password localized; success state shows email-sent confirmation.
- Auth pages redirect to /dashboard if user already has a session.
- middleware.ts:
  * Protects /dashboard, /onboarding, /settings — redirects to /sign-in?redirect=...
  * Auth pages redirect logged-in users to /dashboard
  * Keeps legacy /login and /register redirects
2026-04-30 03:04:15 +03:00