mirror of
https://github.com/strapi/strapi.git
synced 2025-09-20 14:00:48 +00:00
fix(authenticatedApp): catch errors for user id generation silently
This commit is contained in:
parent
00b155bacf
commit
cb84d53dd5
@ -136,8 +136,12 @@ export const AuthenticatedApp = () => {
|
|||||||
// Create a hash of the users email adress and use it as ID for tracking
|
// Create a hash of the users email adress and use it as ID for tracking
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
const generateUserId = async (userInfo) => {
|
const generateUserId = async (userInfo) => {
|
||||||
|
try {
|
||||||
const userId = await hashAdminUserEmail(userInfo);
|
const userId = await hashAdminUserEmail(userInfo);
|
||||||
setUserId(userId);
|
setUserId(userId);
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Generating user id failed', error);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (userInfo) {
|
if (userInfo) {
|
||||||
@ -170,13 +174,7 @@ export const AuthenticatedApp = () => {
|
|||||||
|
|
||||||
const hasApluginNotReady = Object.values(plugins).some((plugin) => plugin.isReady === false);
|
const hasApluginNotReady = Object.values(plugins).some((plugin) => plugin.isReady === false);
|
||||||
|
|
||||||
if (
|
if (isLoadingAppInfos || isLoadingPermissions || hasApluginNotReady) {
|
||||||
!userDisplayName ||
|
|
||||||
!userId ||
|
|
||||||
isLoadingAppInfos ||
|
|
||||||
isLoadingPermissions ||
|
|
||||||
hasApluginNotReady
|
|
||||||
) {
|
|
||||||
const initializers = Object.keys(plugins).reduce((acc, current) => {
|
const initializers = Object.keys(plugins).reduce((acc, current) => {
|
||||||
const InitializerComponent = plugins[current].initializer;
|
const InitializerComponent = plugins[current].initializer;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user