Skip to content

Commit 5984d2e

Browse files
committed
fix(ts): remove createdAt from User object literal in authMiddleware
1 parent 579cdf0 commit 5984d2e

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

src/lib/authMiddleware.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,12 @@ export function getUserFromRequest(request: NextRequest): User | null {
2929
const authHeader = request.headers.get('authorization');
3030
if (authHeader?.startsWith('Bearer ')) {
3131
const token = authHeader.slice(7);
32-
// In production, this would decode and verify the JWT
33-
// For now, we'll use the token as userId and check role from cookie
3432
const roleCookie = request.cookies.get('user-role')?.value as UserRole | undefined;
3533
if (roleCookie) {
3634
return {
3735
id: token,
3836
email: '',
3937
role: roleCookie,
40-
createdAt: new Date().toISOString(),
4138
};
4239
}
4340
}
@@ -49,9 +46,8 @@ export function getUserFromRequest(request: NextRequest): User | null {
4946
id: 'cookie-user',
5047
email: '',
5148
role: roleCookie,
52-
createdAt: new Date().toISOString(),
5349
};
5450
}
5551

5652
return null;
57-
}
53+
}

0 commit comments

Comments
 (0)