chore: login/signup improvements
This commit is contained in:
@@ -34,3 +34,5 @@ yarn-error.log*
|
||||
|
||||
# vercel
|
||||
.vercel
|
||||
|
||||
vite.config.ts*.mjs
|
||||
@@ -1,3 +1,4 @@
|
||||
import { dev } from '$app/environment';
|
||||
import { redirect } from '@sveltejs/kit';
|
||||
import { blockedSubdomain } from '$lib/utils/constants/app';
|
||||
import { getCurrentOrg } from '$lib/utils/services/org';
|
||||
@@ -37,12 +38,12 @@ export const load = async ({ url, cookies }): Promise<LoadOutput> => {
|
||||
response.orgSiteName = debugMode ? _orgSiteName : subdomain;
|
||||
response.org = (await getCurrentOrg(response.orgSiteName, true)) || null;
|
||||
|
||||
if (!response.org) {
|
||||
if (!response.org && !dev) {
|
||||
throw redirect(301, 'https://app.classroomio.com/404?type=org');
|
||||
}
|
||||
} else if (subdomain === 'play' || debugPlay === 'true') {
|
||||
response.skipAuth = true;
|
||||
} else if (subdomain !== 'app') {
|
||||
} else if (subdomain !== 'app' && !dev) {
|
||||
throw redirect(301, 'https://app.classroomio.com');
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import { fly } from 'svelte/transition';
|
||||
import { derived } from 'svelte/store';
|
||||
import { goto } from '$app/navigation';
|
||||
import { browser } from '$app/environment';
|
||||
import { browser, dev } from '$app/environment';
|
||||
import { page, navigating } from '$app/stores';
|
||||
import isEmpty from 'lodash/isEmpty';
|
||||
import { Theme, ToastNotification, Loading } from 'carbon-components-svelte';
|
||||
@@ -56,6 +56,10 @@
|
||||
|
||||
// Set up posthog
|
||||
initPosthog();
|
||||
|
||||
if (!dev) {
|
||||
injectSpeedInsights();
|
||||
}
|
||||
}
|
||||
|
||||
function setAnalyticsUser() {
|
||||
@@ -216,8 +220,6 @@
|
||||
|
||||
setupAnalytics();
|
||||
|
||||
injectSpeedInsights();
|
||||
|
||||
handleResize();
|
||||
|
||||
if (!isSupabaseTokenInLocalStorage() && !isPublicRoute($page.url?.pathname)) {
|
||||
|
||||
@@ -108,8 +108,8 @@
|
||||
const content = `
|
||||
<p>Hello ${fullname},</p>
|
||||
<p>The status of your submitted exercise on <strong>${title}</strong> has been updated to ${
|
||||
submissionStatus[status_id]
|
||||
}</p>
|
||||
submissionStatus[status_id]
|
||||
}</p>
|
||||
${
|
||||
status_id == 3
|
||||
? `<p>Your score was ${totalMark}/${maxMark}</p>
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
});
|
||||
} catch (error) {
|
||||
submitError = error.error_description || error.message;
|
||||
} finally {
|
||||
loading = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,7 +103,6 @@
|
||||
fields = Object.assign({}, SIGNUP_FIELDS);
|
||||
} catch (error) {
|
||||
submitError = error?.error_description || error?.message;
|
||||
} finally {
|
||||
loading = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user