Skip to content

Commit

Permalink
fix: use NextResponse redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
peterphanouvong committed May 28, 2024
1 parent 0ce1328 commit ffb0212
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/handlers/callback.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ export const callback = async (routerClient) => {
);

if (typeof postLoginRedirectURL === 'string')
routerClient.redirect(postLoginRedirectURL);
return routerClient.redirect(postLoginRedirectURL);
};
2 changes: 1 addition & 1 deletion src/handlers/createOrg.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ export const createOrg = async (routerClient) => {
options
);

routerClient.redirect(authUrl.toString());
return routerClient.redirect(authUrl.toString());
};
2 changes: 1 addition & 1 deletion src/handlers/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ export const login = async (routerClient) => {
);
}

routerClient.redirect(authUrl.toString());
return routerClient.redirect(authUrl.toString());
};
2 changes: 1 addition & 1 deletion src/handlers/logout.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ export const logout = async (routerClient) => {
);
}

routerClient.redirect(authUrl.toString());
return routerClient.redirect(authUrl.toString());
};
2 changes: 1 addition & 1 deletion src/handlers/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ export const register = async (routerClient) => {
);
}

routerClient.redirect(authUrl.toString());
return routerClient.redirect(authUrl.toString());
};
3 changes: 1 addition & 2 deletions src/routerClients/AppRouterClient.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {createKindeServerClient} from '@kinde-oss/kinde-typescript-sdk';
import {cookies} from 'next/headers';
import {redirect} from 'next/navigation';
import {NextRequest, NextResponse} from 'next/server';
import {config} from '../config/index';
import {appRouterSessionManager} from '../session/sessionManager';
Expand Down Expand Up @@ -31,7 +30,7 @@ export default class AppRouterClient extends RouterClient {
* @returns
*/
redirect(url) {
return redirect(url);
return NextResponse.redirect(url);
}

/**
Expand Down

0 comments on commit ffb0212

Please sign in to comment.