Skip to content

Commit

Permalink
fix(frontend): rewrite path instead of redirecting
Browse files Browse the repository at this point in the history
  • Loading branch information
AritroSaha10 committed Nov 19, 2023
1 parent 01f9cc4 commit 933cd9a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion frontend/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,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.rewrite(`${baseUrl}/login`);

// Set the cookie in the response header
response.cookies.set('credential', credential, {
Expand Down
1 change: 0 additions & 1 deletion frontend/pages/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export default function Login() {
}, [])

const loginUri = `${inBrowser ? window.location.origin : ""}/auth/redirect`
console.log(loginUri)

// Check whether a new login occured, if so, try to create a user object in DB
useEffect(() => {
Expand Down

0 comments on commit 933cd9a

Please sign in to comment.