Skip to content

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

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

KavishkaVenuka wants to merge 1 commit 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
    • Sign-in buttons in the React TanStack Router sample now correctly start the sign-in flow when clicked.
    • Removed custom sign-in and sign-up route URL configuration from the sample provider.

@coderabbitai

coderabbitai Bot commented Sep 20, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: e1533ef3-9ec8-448b-9845-ed33baf3440c

📥 Commits

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

📒 Files selected for processing (2)
  • samples/react-tanstack-router/src/main.tsx
  • samples/react-tanstack-router/src/pages/Home.tsx
💤 Files with no reviewable changes (1)
  • samples/react-tanstack-router/src/main.tsx

Included review availability: 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.

Priority: ➖ Normal

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix · Severity of issue fixed: Medium

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes both main changes: adding the missing sign-in click handler and removing the invalid sign-in URL.
Description check ✅ Passed The description clearly explains the problem, root cause, fixes, and related issue. It is mostly complete, but it omits the template's Checklist and Security checks sections.
Linked Issues check ✅ Passed The changes satisfy issue #572. Both SignInButton render-prop usages in samples/react-tanstack-router/src/pages/Home.tsx now destructure signIn and set onClick={signIn}. The buttons retain the…
Out of Scope Changes check ✅ Passed The changes remain within the sign-in-flow scope of issue #572. The Home.tsx changes make the two affected buttons invoke sign-in. The main.tsx change removes invalid custom authentication URLs th…
  • Fix all pre-merge checks with AI
✨ 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