Unable to use sample JS app with Google account

I’m trying to create a sample app that allows account linking between someone signing up with email/password and then logging in with Google on the same email. I want the accounts linked to the one I pick as the primary (I’ll be using the Google one as Primary).

I’ve followed the account linking with actions example (Link User Accounts)

Could you help me because I don’t understand

  1. The purpose of the random string in secret: event.secrets.REDIRECT_SECRET. Can you provide an explanation of what this is for? I’ve had a look at the options.secret documentation, but what would be the purpose of redirecting and what should I provide?
  2. What am I supposed to provide for ‘https://url.for/account/linking/service
    Isn’t that something Auth0 provides?

Hi @kizzypig

Welcome to the Auth0 Community!

Reading through your message, allow me to try and answer your questions:

  1. secret: event.secrets.REDIRECT_SECRET → I’ve found this to be defined under the api.redirect.encodeToken(options) object, where options.secret refers to a secret that will be used to sign a JWT that is shared with the redirect target. As the documentation mentions, the secret value should be stored as a secret and retrieved using event.secrets['SECRET_NAME']. This would be a string used to sign and validate your token, that you can set as a Secret within the Action.
  2. https://url.for/account/linking/service → it should refer to where you want to redirect the user after the Account linking has been completed ( usually to the Auth0 dashboard). This is defined under the api.redirect.sendUserTo(url, options) object.

Hope this helped!
Gerald