Skip to content

Commit 3abf5d5

Browse files
committed
refactor(constants): remove unused cookie names for index and folder passwords
Remove `indexPassword` and `folderPassword` from `COOKIES_NAME` as they are no longer used in the application. This cleanup helps in maintaining a leaner codebase by eliminating unnecessary constants. style(middleware): reformat long lines for better readability Reformat long lines in `middleware.ts` to improve code readability and maintainability. This change ensures that the code adheres to style guidelines, making it easier for developers to read and understand.
1 parent d33acb0 commit 3abf5d5

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/constant.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ export const BASE_URL = (() => {
4848
* Cookies name for the app
4949
*/
5050
export const COOKIES_NAME = {
51-
indexPassword: "next-gdrive-index-password",
52-
folderPassword: "next-gdrive-index-folder-password",
5351
viewType: "next-gdrive-index-view-type",
5452
} as const;
5553
export const COOKIES_AGE = 60 * 60 * 24 * 365; // Default: 1 year

src/middleware.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ export async function middleware(req: NextRequest) {
3131
},
3232
});
3333
response.headers.set("X-Pathname", req.nextUrl.pathname);
34-
response.headers.set("Cache-Control", "public, max-age=3600, stale-while-revalidate=59");
34+
response.headers.set(
35+
"Cache-Control",
36+
"public, max-age=3600, stale-while-revalidate=59",
37+
);
3538
if (pathname.startsWith("/ngdi-internal/embed/")) {
3639
response.headers.set("Content-Security-Policy", cspHeader);
3740
return response;
@@ -61,5 +64,7 @@ export async function middleware(req: NextRequest) {
6164
return response;
6265
}
6366
export const config = {
64-
matcher: ["/((?!api|_next/static|_next/image|favicon.ico|sitemap.xml|robots.txt).*)"],
67+
matcher: [
68+
"/((?!api|_next/static|_next/image|favicon.ico|sitemap.xml|robots.txt).*)",
69+
],
6570
};

0 commit comments

Comments
 (0)