feat: enhance security by implementing HttpOnly refresh tokens and in-memory access token management
- Added isomorphic-dompurify for improved XSS protection - Refactored token storage to use in-memory management for access tokens - Implemented server-side route handlers for OAuth token management - Introduced security headers in next.config.js - Removed client-side exposure of client_secret and sensitive tokens - Updated API interceptors to handle token refresh logic - Cleaned up cookie management for refresh tokens
This commit is contained in:
+4
-7
@@ -2,11 +2,8 @@ import { cookies } from "next/headers";
|
||||
|
||||
export async function getUser() {
|
||||
const cookieStore = await cookies();
|
||||
const raw =
|
||||
cookieStore.get("access_token") &&
|
||||
cookieStore.get("refresh_token") &&
|
||||
cookieStore.get("uuid") &&
|
||||
cookieStore.get("userInfo");
|
||||
if (!raw) return null;
|
||||
return raw;
|
||||
const isAuthenticated =
|
||||
cookieStore.get("refresh_token") && cookieStore.get("userInfo");
|
||||
if (!isAuthenticated) return null;
|
||||
return cookieStore.get("userInfo");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user