小编kca*_*rra的帖子

开玩笑地在 @auth0 中嘲笑 Auth0Client

我正在尝试在反应应用程序中模拟出来import { Auth0Provider } from "@auth0/auth0-react";,并不断遇到此错误的问题[Error: For security reasons, window.crypto is required to run auth0-spa-js.]据我所知,此错误来自从Auth0Client导入的import { Auth0Client } from '@auth0/auth0-spa-js';我的想法是模拟作用域模块@auth0/auth0-spa-js并执行类似的操作

const handleRedirectCallback = jest.fn(() => ({ appState: {} }));
const buildLogoutUrl = jest.fn();
const buildAuthorizeUrl = jest.fn();
const checkSession = jest.fn();
const getTokenSilently = jest.fn();
const getTokenWithPopup = jest.fn();
const getUser = jest.fn();
const getIdTokenClaims = jest.fn();
const isAuthenticated = jest.fn(() => false);
const loginWithPopup = jest.fn();
const loginWithRedirect = …
Run Code Online (Sandbox Code Playgroud)

reactjs jestjs auth0

2
推荐指数
1
解决办法
3122
查看次数

标签 统计

auth0 ×1

jestjs ×1

reactjs ×1