CLASSROOMIO-T-45: Handle domains not found

This commit is contained in:
Rotimi Best
2023-05-15 21:48:35 +01:00
parent e062ad20e7
commit 8d0f1e4de1
3 changed files with 10 additions and 4 deletions
+1 -2
View File
@@ -98,11 +98,10 @@
// Set user in sentry
Sentry.setUser($profile);
const orgRes = await getOrganizations($profile.id);
if ($appStore.isStudentDomain) {
// student redirect
} else {
const orgRes = await getOrganizations($profile.id);
// If user coming to login page, then
if (isEmpty(orgRes.orgs)) {
goto(ROUTE.ONBOARDING);
+1
View File
@@ -1,6 +1,7 @@
export const blockedSubdomain = [
'app',
'apps',
'play',
'support',
'help',
'teachers',
+8 -2
View File
@@ -141,8 +141,14 @@ export async function getCourseBySiteName(siteName) {
if (error) {
return [];
}
currentOrg.set(get(data, '[0].group.organization'));
const org = get(data, '[0].group.organization', {
id: '',
name: 'ClassroomIO',
shortName: '',
siteName: '',
avatar_url: '/logo-192.png',
});
currentOrg.set(org);
return data;
}