Uh oh!
There was an error while loading. Please reload this page.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: clerk/javascript
Length of output: 176
🏁 Script executed:
Repository: clerk/javascript
Length of output: 7354
🏁 Script executed:
Repository: clerk/javascript
Length of output: 3163
🏁 Script executed:
Repository: clerk/javascript
Length of output: 574
🏁 Script executed:
Repository: clerk/javascript
Length of output: 8269
🏁 Script executed:
Repository: clerk/javascript
Length of output: 2066
🏁 Script executed:
Repository: clerk/javascript
Length of output: 191
🏁 Script executed:
Repository: clerk/javascript
Length of output: 131
🏁 Script executed:
Repository: clerk/javascript
Length of output: 1639
🏁 Script executed:
Repository: clerk/javascript
Length of output: 1880
isValidBrowser()andisBrowserOnline()returningtruefor all non-navigator cases breaks webauthn guard semanticsLines 60 and 76 returning
truefor all non-browser runtimes (not just React Native) creates a safety issue. Inpackages/shared/src/webauthn.ts:8–10, the guard patternisValidBrowser() && typeof window.PublicKeyCredential === 'function'relies on the first condition beingfalsein non-browser environments. With this change, SSR/Node.js environments will pass the first condition (true), then evaluatetypeof window.PublicKeyCredential, which throwsReferenceError: window is not definedsincetypeofdoesn't protect property access.The test comment correctly identifies the intent ("React Native"), but the implementation conflates React Native with generic non-browser runtimes. Narrow the
truereturn to React Native detection only:🤖 Prompt for AI Agents