@liujitcn/kratos-taro-app-core 0.0.32 → 0.0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -223,8 +223,8 @@ export async function encryptPassword(
|
|
|
223
223
|
const publicKeyResponse = await defLoginService.PasswordPublicKey({ scene })
|
|
224
224
|
|
|
225
225
|
const cryptoApi = globalThis.crypto
|
|
226
|
-
|
|
227
|
-
if (process.env.TARO_ENV === 'weapp' || !cryptoApi?.subtle) {
|
|
226
|
+
const isSecureContext = typeof window === 'undefined' || window.isSecureContext
|
|
227
|
+
if (process.env.TARO_ENV === 'weapp' || !cryptoApi?.subtle || !isSecureContext) {
|
|
228
228
|
return encryptPortablePassword(miniCrypto, plainPassword, publicKeyResponse)
|
|
229
229
|
}
|
|
230
230
|
|