Skip to content

Conversation

@mkcode
Copy link
Contributor

@mkcode mkcode commented Nov 4, 2025

I found that in certain situations, such as using subdomains with better auth, that authClient.useSession() returns undefined data. This then causes an undefined id on undefined error here. This fixes the issue and makes this work again.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copilot AI review requested due to automatic review settings November 4, 2025 18:26
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a potential runtime error by adding optional chaining to safely access the session property. The change prevents a crash when session.session is undefined.

Key changes:

  • Added optional chaining operator (?.) to session.session.id access

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

1 participant