Describe the bug
authkitMiddleware doesn't use redirectUri from env variable when the option is not explicitly provided.
Instead, the redirect flow falls back to the default redirect URI configured in the WorkOS dashboard, which breaks authentication in dynamic or preview environments.
To Reproduce
- Set the redirect URI using environment variables (e.g.
WORKOS_REDIRECT_URI).
- Use
authkitMiddleware() without passing a redirectUri option.
- Start an authentication flow.
- Observe that the redirect flow uses the default redirect URI from the WorkOS dashboard instead of the env variable.
Expected behavior
When redirectUri is not provided, authkitMiddleware should use the redirect URI defined in env variables rather than falling back to the WorkOS dashboard default.
Desktop (please complete the following information):
- OS: macOS
- Browser: Chrome
- authkit-tanstack-react-start version: 0.5.0
- TanStack Start version: 1.158.0
Describe the bug
authkitMiddlewaredoesn't useredirectUrifrom env variable when the option is not explicitly provided.Instead, the redirect flow falls back to the default redirect URI configured in the WorkOS dashboard, which breaks authentication in dynamic or preview environments.
To Reproduce
WORKOS_REDIRECT_URI).authkitMiddleware()without passing aredirectUrioption.Expected behavior
When
redirectUriis not provided,authkitMiddlewareshould use the redirect URI defined in env variables rather than falling back to the WorkOS dashboard default.Desktop (please complete the following information):