Skip to content

Commit

Permalink
fix(frontend): redirect with 302 found
Browse files Browse the repository at this point in the history
  • Loading branch information
AritroSaha10 committed Nov 19, 2023
1 parent 9208590 commit b485730
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export async function middleware(request: NextRequest, event: NextFetchEvent) {

// Create a new response object
const baseUrl = request.url.substring(0, request.url.indexOf(new URL(request.url).pathname));
const response = NextResponse.redirect(`${baseUrl}/login`);
const response = NextResponse.redirect(`${baseUrl}/login`, 302);

// Set the cookie in the response header
response.cookies.set('credential', credential, {
Expand All @@ -70,7 +70,7 @@ export async function middleware(request: NextRequest, event: NextFetchEvent) {
console.error(e);

const baseUrl = request.url.substring(0, request.url.indexOf(new URL(request.url).pathname));
const response = NextResponse.redirect(`${baseUrl}/login`);
const response = NextResponse.redirect(`${baseUrl}/login`, 302);

return response;
}
Expand Down

0 comments on commit b485730

Please sign in to comment.