K
Kinde3mo ago
MadLex

Remix: onRedirectCallback Functionality in Documentation

The current documentation for the onRedirectCallback function appears to be misleading or outdated. Specifically, it suggests that the handleAuth function accepts a third parameter, which can be used to define a callback to be executed after user authentication. However, based on my experience, the handleAuth function only accepts two parameters: request: Request and route: any. This discrepancy makes it difficult to implement the feature as described. I was trying to call the onRedirectCallback function after a user has been successfully authenticated, as per the instructions provided in the documentation. My goal was to execute some custom logic after the authentication step, such as logging user information. Here’s the specific code I used:
import {handleAuth} from "@kinde-oss/kinde-remix-sdk";
import {LoaderFunctionArgs} from "@remix-run/node";

export async function loader({params, request}: LoaderFunctionArgs) {
return await handleAuth(request, params.index, {
onRedirectCallback({user}) {
console.log("This is called after the user is authenticated!", user);
}
});
}
import {handleAuth} from "@kinde-oss/kinde-remix-sdk";
import {LoaderFunctionArgs} from "@remix-run/node";

export async function loader({params, request}: LoaderFunctionArgs) {
return await handleAuth(request, params.index, {
onRedirectCallback({user}) {
console.log("This is called after the user is authenticated!", user);
}
});
}
Unfortunately, this approach doesn't work because handleAuth seems to only accept two parameters, not three as indicated. My requirement is to be able to execute a function after authentication, and it’s unclear from the documentation how to correctly implement this. A clear, updated example or additional guidance on handling post-authentication logic would greatly assist developers in using this SDK effectively. Here's the GitHub issue I created a week ago: https://github.com/kinde-oss/kinde-remix-sdk/issues/17 Best Regards!
GitHub
Documentation issue: onRedirectCallback Functionality in Documentat...
Prerequisites I have searched the repository’s issues and the Kinde community to ensure my documentation issue isn’t a duplicate I have read the contributing guidelines I agree to the terms within ...
10 Replies
IkiTg07
IkiTg073mo ago
Hey, we've told the team about your issue they should get back to you
Oli - Kinde
Oli - Kinde3mo ago
Hey @MadLex, Thanks for posting your issue here and raising a GitHub issue on the Remix SDK repo. My Remix expert teammate is aware of this issue and will respond on the GitHub issue with any updates.
MadLex
MadLexOP3mo ago
Thanks!
Oli - Kinde
Oli - Kinde3mo ago
No worries.
MadLex
MadLexOP3mo ago
Looks like now it's correctly added in the function but the user returned is null Already reached Peter on the same Github issue and PR #16 🫡
Oli - Kinde
Oli - Kinde3mo ago
Ill make sure Peter is aware of this.
MadLex
MadLexOP3mo ago
Thanks! hey @Oli - Kinde can you ping him again please? Thanks!
Oli - Kinde
Oli - Kinde3mo ago
Hey @MadLex, I will speak to Peter tomorrow on this.
MadLex
MadLexOP3mo ago
Great, Thanks!
Oli - Kinde
Oli - Kinde3mo ago
I pinged Peter on this. Its on his backlog to look into your comments on the Remix SDK on GitHub
Want results from more Discord servers?
Add your server