diff --git a/src/utils/CryptoUtils.ts b/src/utils/CryptoUtils.ts index 66e77782f..5f3fdd895 100644 --- a/src/utils/CryptoUtils.ts +++ b/src/utils/CryptoUtils.ts @@ -38,6 +38,10 @@ export class CryptoUtils { * PKCE: Generate a code challenge */ public static async generateCodeChallenge(code_verifier: string): Promise { + if (!crypto.subtle) { + throw new Error("Crypto.subtle is available only in secure contexts (HTTPS)."); + } + try { const encoder = new TextEncoder(); const data = encoder.encode(code_verifier);