feat(02-02): auth infrastructure -- route groups, middleware, session, auth-actions, auth store

- Create (auth) route group with standalone layout (no sidebar/header, D-04)
- Create (portal) route group wrapping children with AppShell
- Move dashboard page into (portal) route group
- Add Next.js middleware for JWT-based route protection using jose
- Create session.ts with verifySession/getSessionFromCookies helpers
- Create auth-actions.ts server actions: login, logout, fetchCurrentUser
- Create Zustand auth-store for client-side user state
- Install jose and zod dependencies

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-18 13:32:53 +02:00
parent 47f765ca99
commit cdf4d60038
10 changed files with 356 additions and 45 deletions
+16
View File
@@ -99,6 +99,9 @@ importers:
apps/web:
dependencies:
jose:
specifier: ^6.2.3
version: 6.2.3
next:
specifier: ^15.3.0
version: 15.5.19(react-dom@19.2.7(react@19.2.7))(react@19.2.7)
@@ -114,6 +117,9 @@ importers:
react-dom:
specifier: ^19.0.0
version: 19.2.7(react@19.2.7)
zod:
specifier: ^4.4.3
version: 4.4.3
zustand:
specifier: ^5.0.14
version: 5.0.14(@types/react@19.2.17)(react@19.2.7)
@@ -1745,6 +1751,9 @@ packages:
resolution: {integrity: sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==}
hasBin: true
jose@6.2.3:
resolution: {integrity: sha512-YYVDInQKFJfR/xa3ojUTl8c2KoTwiL1R5Wg9YCydwH0x0B9grbzlg5HC7mMjCtUJjbQ/YnGEZIhI5tCgfTb4Hw==}
js-tokens@4.0.0:
resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}
@@ -2559,6 +2568,9 @@ packages:
resolution: {integrity: sha512-U/PBtDf35ff0D8X8D0jfdzHYEPFxAI7jJlxZXwCSez5M3190m+QobIfh+sWDWSHMCWWJN2AWamkegn6vr6YBTw==}
engines: {node: '>=18'}
zod@4.4.3:
resolution: {integrity: sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==}
zustand@5.0.14:
resolution: {integrity: sha512-/8tAspM5LMPr28b3fwLYrtdj77ECpfZviaP75CMTnwO8ISyaE4GDIG/9rDDYq/cH9D2Xw2A2RXglLInmVBQB/g==}
engines: {node: '>=12.20.0'}
@@ -4119,6 +4131,8 @@ snapshots:
jiti@2.7.0: {}
jose@6.2.3: {}
js-tokens@4.0.0: {}
js-yaml@4.2.0:
@@ -4906,6 +4920,8 @@ snapshots:
yoctocolors-cjs@2.1.3: {}
zod@4.4.3: {}
zustand@5.0.14(@types/react@19.2.17)(react@19.2.7):
optionalDependencies:
'@types/react': 19.2.17