Skip to content

Require user authentication for Dataplayer features and updates#119

Merged
ritwikshanker merged 5 commits into
mainfrom
bugfix/auth-errors
Jun 24, 2026
Merged

Require user authentication for Dataplayer features and updates#119
ritwikshanker merged 5 commits into
mainfrom
bugfix/auth-errors

Conversation

@ritwikshanker

Copy link
Copy Markdown
Collaborator

This pull request improves the authentication experience and error handling for gated pages (Data Sandbox, chat, and profile). It ensures users are returned to the page they came from after logging in, and prevents misleading errors from showing when not authenticated. The main changes include a new post-login redirect mechanism, improved login prompts, and better handling of unauthenticated states in the Data Sandbox.

Authentication flow improvements:

  • Added a new authRedirect.ts helper module that stashes the intended page in sessionStorage before login and returns the user to that page after authentication. (src/lib/authRedirect.ts)
  • Updated login buttons on gated pages (ChatPage, ProfilePage, and DataplayerPage) to use the new loginWithReturn function, ensuring users return to their original page after logging in. (src/pages/ChatPage.tsx, [1]; src/pages/ProfilePage.tsx, [2]; src/pages/DataplayerPage.tsx, [3]

Data Sandbox (Dataplayer) error handling:

  • Modified the useDataset hook to delay API calls until the user is authenticated, preventing "failed to fetch files" errors when the user is not logged in. (src/hooks/useDataplayerHooks.ts, [1] [2] [3]
  • The Data Sandbox now displays a clear authentication prompt overlay when accessed while logged out, rather than showing file fetch errors. (src/pages/DataplayerPage.tsx, [1] [2] [3]

Changelog updates:

  • Updated CHANGELOG.md for version 0.8.5 to document the improved login flow and error handling for gated pages.

These changes make the authentication experience smoother and prevent confusing error messages for users accessing restricted pages while logged out.

Copilot AI review requested due to automatic review settings June 24, 2026 08:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ritwikshanker ritwikshanker merged commit da8f4a2 into main Jun 24, 2026
5 checks passed
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