Skip to content

(SP: 2) [Frontend] Remove [locale] layout force-dynamic and move auth to client-side #369

@ViktorSvertoka

Description

@ViktorSvertoka

Summary

Remove auth/cookie access from `app/[locale]/layout.tsx` so public locale pages can use static/ISR rendering.

Scope

  • Update `/api/auth/me` to return lightweight auth payload and no-store
  • Add `useAuth` + `AuthProvider`
  • Move header auth consumption to client hook
  • Keep dashboard explicitly dynamic via `app/[locale]/dashboard/layout.tsx`

Acceptance Criteria

  • `app/[locale]/layout.tsx` has no `getCurrentUser()` and no `force-dynamic`
  • Header auth state is loaded via client API
  • Dashboard remains dynamic (`force-dynamic`)
  • Target files pass lint

Metadata

Metadata

Labels

performancePerformance and efficiency optimizations without functional changes.

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions