Skip to content

fix(samples): add missing onClick handler and remove invalid signInUrl in tanstack-router sample - #573

Open
KavishkaVenuka wants to merge 2 commits into
asgardeo:mainfrom
KavishkaVenuka:fix/tanstack-router-sample-signin-button
Open

KavishkaVenuka wants to merge 2 commits into
asgardeo:mainfrom
KavishkaVenuka:fix/tanstack-router-sample-signin-button

Conversation

@KavishkaVenuka

@KavishkaVenuka KavishkaVenuka commented Sep 20, 2026 •

Copy link
Copy Markdown

Purpose

This PR fixes a broken sign-in flow in the react-tanstack-router sample application.

The Problem:

  1. The SignInButton in Home.tsx was missing the onClick handler when using the render-prop pattern, rendering the buttons completely non-functional.
  2. signInUrl="/signin" was incorrectly configured in the AsgardeoProvider inside main.tsx. Because the router has no /signin route, clicking the button resulted in a "Not Found" routing error instead of initiating the Asgardeo OAuth flow.

The Fix:

  1. Added onClick={signIn} to the <button> elements inside the render-props in Home.tsx.
  2. Removed the invalid signInUrl and signUpUrl props from the AsgardeoProvider configuration in main.tsx, allowing the SDK to correctly default to the standard Asgardeo redirect flow.

Related Issues

Related PRs

  • N/A

Summary by CodeRabbit

  • Bug Fixes
    • In the React TanStack Router sample, clicking either sign-in button now starts the sign-in flow. The buttons retain their loading labels and disabled states while loading.
  • Configuration Changes
    • The sample no longer specifies custom URLs for its sign-in and sign-up routes in the authentication provider.

@coderabbitai

coderabbitai Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: c608e1e7-bf2a-44ea-8107-210e6452db8f

📥 Commits

Reviewing files that changed from the base of the PR and between aff76bc and 2ad334e.

📒 Files selected for processing (1)
  • samples/react-tanstack-router/src/pages/Home.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • samples/react-tanstack-router/src/pages/Home.tsx

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The sample removes custom authentication route overrides. Both sign-in buttons now invoke the signIn function when clicked.

Changes

TanStack Router sign-in flow

Layer / File(s) Summary
Authentication provider configuration
samples/react-tanstack-router/src/main.tsx
The AsgardeoProvider no longer specifies custom signInUrl and signUpUrl values.
Sign-in button handlers
samples/react-tanstack-router/src/pages/Home.tsx
The navigation and hero SignInButton render props now bind signIn to their button onClick handlers. The Home component also has a descriptive comment.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 2ad33

No identified issue prevents merging the sign-in flow change after normal checks.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies both primary changes: adding the missing sign-in click handler and removing the invalid sign-in URL.
Description check ✅ Passed The description clearly explains the problem, the fix, and related issue #572. It omits the repository template's Checklist and Security checks sections, but the main required change information is co…
Linked Issues check ✅ Passed The changes satisfy issue #572. Both SignInButton render props in samples/react-tanstack-router/src/pages/Home.tsx now destructure signIn and set onClick={signIn}. The buttons retain the loadi…
Out of Scope Changes check ✅ Passed The changes stay within issue #572. The Home.tsx comment supports the affected sample, and removing signInUrl and signUpUrl from AsgardeoProvider supports the standard sign-in flow. No unrelat…
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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.

This branch has not been deployed

No deployments
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.

Bug: SignInButton render prop usage in "react-tanstack-router" sample missing "onClick={signIn}"

1 participant