Welcome to the Kinde community

Home
Members
bazar21
b
bazar21
Offline, last seen 5 hours ago
Joined January 6, 2025
I am using sequence below to test if a user is authenticated or not. However, this causes an async call to kinde as I understand for each isAuthenticated() for ex.

Is there a better way to handle this and obtain the authentication status?
const { getUser, isAuthenticated } = getKindeServerSession();
const authenticated = (await isAuthenticated());
const newuser = await getUser();
if (authenticated) {
const newuser = await getUser();
2 comments
A
b
I am looking to save new user details once a usr sign-up to my site.
As of now I see there is a way to do that here: https://docs.kinde.com/developer-tools/sdks/frontend/javascript-sdk/#handle-redirect
But where am I supposed to put the codebelow?
on_redirect_callback: (user, appState) => {
console.log({user, appState});
if (user) {
// render logged in view
} else {
// render logged out view
}
};
I sense I am missing something as I don't have a proper place to put this into as my sign-up/login/logout works ok, just need to save new sign-up details in database and need a place to put that action on a post sign-up event.
6 comments
I
b