Skip to content

Commit

Permalink
Fix gotrue crashing on ReactNative
Browse files Browse the repository at this point in the history
  • Loading branch information
MarceloPrado authored Aug 30, 2023
1 parent 22923e7 commit c3f0079
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,9 @@ function base64urlencode(str: string) {
}

export async function generatePKCEChallenge(verifier: string) {
if (typeof crypto === 'undefined') {
const hasCryptoSupport = typeof crypto !== 'undefined' && typeof crypto.subtle !== 'undefined' && typeof TextEncoder !== 'undefined';

if (!hasCryptoSupport) {
console.warn(
'WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256.'
)
Expand Down

0 comments on commit c3f0079

Please sign in to comment.