Skip to content

fix(nextjs): resolve the hosted sign-up page for the redirect-based sign-up - #556

Open
DonOmalVindula wants to merge 1 commit into
asgardeo:mainfrom
DonOmalVindula:fix/nextjs-redirect-signup
Open

fix(nextjs): resolve the hosted sign-up page for the redirect-based sign-up#556
DonOmalVindula wants to merge 1 commit into
asgardeo:mainfrom
DonOmalVindula:fix/nextjs-redirect-signup

Conversation

@DonOmalVindula

Copy link
Copy Markdown
Contributor

Problem

<SignUpButton /> without a configured signUpUrl, and useAsgardeo().signUp(), did nothing: signUpAction returned {signUpUrl: ''} for a non-embedded sign-up (the client provider ignores an empty URL), and AsgardeoNextClient.signUp(options) threw "Not implemented". The React SDK navigates to the identity server's self-registration page built by getRedirectBasedSignUpUrl(config), which @asgardeo/javascript already exports.

Fix

  • AsgardeoNextClient.getSignUpUrl() returns the configured signUpUrl, or the self-registration page derived from baseUrl, clientId and applicationId (https://accounts.asgardeo.io/t/<org>/accountrecoveryendpoint/register.do?client_id=...&spId=... for Asgardeo).
  • signUpAction without a payload returns that URL; the client provider's existing navigateTo takes the browser there. When no URL can be resolved (for example a custom domain without signUpUrl) the action reports an error that names signUpUrl / NEXT_PUBLIC_ASGARDEO_SIGN_UP_URL, instead of a silent no-op.
  • signUp(options) on the server-side client still throws, since it cannot navigate, but the message now points at getSignUpUrl(). The action's JSDoc no longer describes sign-in.

Testing

  • New signUpAction tests (redirect URL, unresolvable URL, incomplete embedded step, completed flow with auto sign-in) and getSignUpUrl tests (derived Asgardeo URL, configured signUpUrl wins, unrecognised base URL); 68 tests pass.
  • pnpm lint and tsc --noEmit for @asgardeo/nextjs.

Changeset included (@asgardeo/nextjs patch).

🤖 Generated with Claude Code

…ign-up

SignUpButton and useAsgardeo().signUp() did nothing unless a custom signUpUrl
was configured: signUpAction returned an empty URL and the client threw
"Not implemented" for a non-embedded sign-up.

- AsgardeoNextClient.getSignUpUrl() returns the configured signUpUrl, or the
  identity server's self-registration page derived from baseUrl, clientId and
  applicationId (getRedirectBasedSignUpUrl), as the React SDK does.
- signUpAction hands that URL to the browser, which navigates there, and
  reports an error when no URL can be resolved instead of silently doing
  nothing.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 32 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 43ebe769-fa39-4d26-b578-36d3eceb6e67

📥 Commits

Reviewing files that changed from the base of the PR and between 409ebae and 5b664c7.

📒 Files selected for processing (5)
  • .changeset/nextjs-redirect-signup.md
  • packages/nextjs/src/AsgardeoNextClient.ts
  • packages/nextjs/src/__tests__/AsgardeoNextClient.signUp.test.ts
  • packages/nextjs/src/server/actions/__tests__/signUpAction.test.ts
  • packages/nextjs/src/server/actions/signUpAction.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@asgardeo-github-bot

Copy link
Copy Markdown

🦋 Changeset detected

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants