diff --git a/src/client/authorization-code.ts b/src/client/authorization-code.ts index b2a7180..eafc1d2 100644 --- a/src/client/authorization-code.ts +++ b/src/client/authorization-code.ts @@ -230,6 +230,11 @@ async function getWebCrypto(): Promise { // Browsers if ((typeof window !== 'undefined' && window.crypto)) { + if (!window.crypto.subtle?.digest) { + throw new Error( + "The context/environment is not secure, and does not support the 'crypto.subtle' module. See: https://developer.mozilla.org/en-US/docs/Web/API/Crypto/subtle for details" + ); + } return window.crypto; } // Web workers possibly