Account Linking - Actions + Auth0 + NextJS

I have scoured the internet. Read all the posts. Scaned GitHub like a bot. Had dreams about the documentation

I still cannot figure out how to do this properly. For one, the text and the code do different things, and additionally, when I try to authenticate with the other connection, I get sent back through the action, creating a big loop.

I am highly motivated to figure this out and want to hear from anyone who has solved the problem.

One slight difference in my implementation compared to the documentation is that I want to automatically prompt users to sign in with accounts using the matching email.

Please help!

Hi @brent1

Welcome to the Auth0 Community!

I am sorry about the late reply to your post.

What is the issue that you are facing exactly in implementing account linking for your application?

By following the documentation you have linked yourself about account linking, you should be able to accomplish it without any difficulties.

Otherwise, since you want to prompt users to sign in with an account matching the linked emails, that is also referenced in the documentation here:

api.redirect.sendUserTo('https://url.for/account/linking/service', {
    query: { session_token: sessionToken },
  });

However, you will need to implement the page where the user is selecting the accounts from.

To help troubleshoot this further if the issue persists, I would ask you to show the code inside your action and share with us any errors that you receive on this post or create a new one.

If you have already found a solution to the issue or if you have any other question that I can help you with, feel free to leave a reply.

Kind Regards,
Nik

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.