Sign up with redirect with custom Sign up page

Greetings everyone!

Environment

  • I am using Universal Login with custom Html for Login Page
  • I am using a separate Nextjs app for Signup page

Problem

  • I need to redirect the user to the url entered when signing up using custom sign up page
    I can already to do that during login by using appState and onRedirectCallback

For example:

  • If I enter this url mywebsite/setting/profile
  • I land on login page
  • I login and land on mywebsite/setting/profile using appState

However, if I click “Sign up” button,

  • I obtain the redirectUrl from the config of custom login script as shown below
 window.addEventListener('load', function () {
        var config = JSON.parse(
          decodeURIComponent(escape(window.atob('@@config@@')))
        );
...
const redirectUrl = config.callbackURL
  • I navigate user to our signup app with the above redirectUrl like myCustomSignupWebsite?redirectUrl=mywebsite.com. . This redirectUrl from the config contains only base url like mywebsite.com
  • However, I want the url to be like myCustomSignupWebsite?redirectUrl=mywebsite.com/setting/profile. So I can land on the correct page after signup

How can I obtain this lost information and make it work like as it is working on the universal login page?