Conversation
nholden
approved these changes
Oct 27, 2025
## Summary This release adds new callback customization features and fixes critical bugs in session management and development setup. ## Changes ### ✨ Features - **Add onSuccess and onError hooks to callback route** (#9) - Changed `handleCallbackRoute` from direct handler to factory function accepting options - `onSuccess` hook provides access to full auth data (oauthTokens, authenticationMethod, organizationId, custom state) - `onError` hook enables custom error responses and logging - Provides feature parity with Next.js SDK - **Breaking change**: `handleCallbackRoute()` now requires parentheses (options parameter is optional) ### 🐛 Bug Fixes - **Fix signOut to use configured session cookie name** (#8) - Fixed hardcoded 'wos_session' cookie name - Now dynamically uses configured cookie name via `getConfig('cookieName')` - Resolves auth state confusion after sign-out - Fixes #6 ### 🔧 Maintenance - Remove dotenv direct invocation in vite.config (#10) - Package updates and type fixes ## Migration Guide If you're using `handleCallbackRoute`: **Before:** ```typescript export const Route = createFileRoute('/api/auth/callback')({ loader: handleCallbackRoute }); ``` **After:** ```typescript export const Route = createFileRoute('/api/auth/callback')({ loader: handleCallbackRoute() // Note the parentheses }); ``` Or with hooks: ```typescript loader: handleCallbackRoute({ onSuccess: async (data) => { console.log('User authenticated:', data.user.email); } }) ``` ## Testing - Updated tests to use correct default cookie name - Example app demonstrates new callback hooks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This release adds new callback customization features and fixes critical bugs in session management and development setup.
Changes
✨ Features
handleCallbackRoutefrom direct handler to factory function accepting optionsonSuccesshook provides access to full auth data (oauthTokens, authenticationMethod, organizationId, custom state)onErrorhook enables custom error responses and logginghandleCallbackRoute()now requires parentheses (options parameter is optional)🐛 Bug Fixes
getConfig('cookieName')🔧 Maintenance
Migration Guide
If you're using
handleCallbackRoute:Before:
After:
Or with hooks:
Testing