fix(admin): resolved undefined on redirect after admin signup

This commit is contained in:
Akhil Mohan
2024-02-21 14:09:28 +05:30
parent 3260932741
commit 7c098529f7
4 changed files with 31 additions and 8 deletions
@@ -96,7 +96,11 @@ export const superAdminServiceFactory = ({
const initialOrganizationName = appCfg.INITIAL_ORGANIZATION_NAME ?? "Admin Org";
await orgService.createOrganization(userInfo.user.id, userInfo.user.email, initialOrganizationName);
const organization = await orgService.createOrganization(
userInfo.user.id,
userInfo.user.email,
initialOrganizationName
);
await updateServerCfg({ initialized: true });
const token = await authService.generateUserTokens({
@@ -106,7 +110,7 @@ export const superAdminServiceFactory = ({
organizationId: undefined
});
// TODO(akhilmhdh-pg): telemetry service
return { token, user: userInfo };
return { token, user: userInfo, organization };
};
return {