mirror of
https://github.com/Luchexx/wacrm.git
synced 2026-11-02 09:19:51 +00:00
Self-hostable CRM template for WhatsApp — shared inbox, contacts, sales pipelines, broadcasts, and no-code automations. Fork it, brand it, host it.
PR #5 switched client components to getSession() but missed src/hooks/use-auth.ts. The auth hook was still calling supabase.auth.getUser() which makes a network round-trip to Supabase, and on some deployments the request was hanging long enough to trigger the 10-second safety timeout: [browser] [useAuth] getUser() timed out after 10s, clearing loading state This caused the dashboard to sit on the loading spinner for the full 10 seconds on every page load. Changes: - Replaced getUser() with getSession() in init() — reads from localStorage synchronously (no network). - Reduced safety timer from 10s to 3s. getSession() shouldn't take more than a few hundred ms; 3s is a reasonable ceiling. Security note (same reasoning as PR #5): - The middleware server-side STILL uses getUser() to verify the JWT against Supabase on every request, so unauthenticated users can't reach protected routes. - RLS on the database is the actual authorization boundary. - getSession() on the client is only used to decide what UI to render. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| public | ||
| src | ||
| supabase/migrations | ||
| .gitignore | ||
| AGENTS.md | ||
| CLAUDE.md | ||
| components.json | ||
| eslint.config.mjs | ||
| next.config.ts | ||
| package-lock.json | ||
| package.json | ||
| postcss.config.mjs | ||
| README.md | ||
| tsconfig.json | ||
This is a Next.js project bootstrapped with create-next-app.
Getting Started
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.
Learn More
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
Deploy on Vercel
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.