fix(frontend): fix handleFetch skipping auth for /api/users/me endpoints and regenerate API types
The handleFetch hook previously skipped auth headers for all URLs containing /api/users/me. Since the hook's own user-load call uses globalThis.fetch (bypassing handleFetch), it is safe to remove this exception — enabling profile update and password change actions to authenticate properly. Also regenerates API types with new profile endpoints and AppUser fields. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -63,9 +63,8 @@ const userGroup: Handle = async ({ event, resolve }) => {
|
||||
export const handleFetch: HandleFetch = async ({ event, request, fetch }) => {
|
||||
const apiUrl = env.API_INTERNAL_URL || 'http://localhost:8080';
|
||||
const isApi = request.url.startsWith(apiUrl) || request.url.includes('/api/');
|
||||
const isNotLoginTest = !request.url.includes('/api/users/me');
|
||||
|
||||
if (isApi && isNotLoginTest) {
|
||||
if (isApi) {
|
||||
const token = event.cookies.get('auth_token');
|
||||
|
||||
if (!token) {
|
||||
|
||||
Reference in New Issue
Block a user