File tree Expand file tree Collapse file tree 3 files changed +34
-13
lines changed Expand file tree Collapse file tree 3 files changed +34
-13
lines changed Original file line number Diff line number Diff line change 4545 <v-app-bar-nav-icon @click.stop =" toggleDrawer" ></v-app-bar-nav-icon >
4646 </SkMouseTrapToolTip >
4747 <v-spacer ></v-spacer >
48- <user-login-and-registration-container :show-registration =" shouldShowRegistration ()" />
48+ <user-login-and-registration-container :show-registration =" isRegistrationEnabled ()" />
4949 </v-app-bar >
5050
5151 <v-main >
@@ -89,6 +89,7 @@ import {
8989 useConfigStore ,
9090 useAuthStore ,
9191} from ' @vue-skuilder/common-ui' ;
92+ import { isRegistrationEnabled } from ' ./utils/registrationGuard' ;
9293
9394defineOptions ({
9495 name: ' App' ,
@@ -104,10 +105,6 @@ const rail = ref(false);
104105
105106const ready = ref (false );
106107
107- const shouldShowRegistration = () => {
108- return ! window .location .href .includes (' eduquilt.com' );
109- };
110-
111108const toggleDrawer = () => {
112109 drawer .value = ! drawer .value ;
113110 // Optional: reset rail when drawer is toggled
Original file line number Diff line number Diff line change 11import { MarkdownRenderer , getCurrentUser } from '@vue-skuilder/common-ui' ;
22import { useAuthRedirectStore } from './stores/useAuthRedirectStore' ;
3+ import { isRegistrationEnabled } from './utils/registrationGuard' ;
34import { createRouter , createWebHistory } from 'vue-router' ;
45import ClassroomCtrlPanel from './components/Classrooms/ClassroomCtrlPanel.vue' ;
56import JoinCode from './components/Classrooms/JoinCode.vue' ;
@@ -18,7 +19,7 @@ import ReleaseNotes from './views/ReleaseNotes.vue';
1819import VerifyEmailView from './views/VerifyEmail.vue' ;
1920import RequestPasswordResetView from './views/RequestPasswordReset.vue' ;
2021import ResetPasswordView from './views/ResetPassword.vue' ;
21- // import SignUp from './views/SignUp.vue';
22+ import SignUp from './views/SignUp.vue' ;
2223import Study from './views/Study.vue' ;
2324import User from './views/User.vue' ;
2425import DataInputFormTester from './dev/DataInputFormTester.vue' ;
@@ -64,13 +65,16 @@ const router = createRouter({
6465 name : 'login' ,
6566 component : Login ,
6667 } ,
67- // Suppress signup for now
68- //
69- // {
70- // path: '/signup',
71- // name: 'signup',
72- // component: SignUp,
73- // },
68+ {
69+ path : '/signup' ,
70+ name : 'signup' ,
71+ component : SignUp ,
72+ beforeEnter : ( ) => {
73+ if ( ! isRegistrationEnabled ( ) ) {
74+ return { name : 'home' } ;
75+ }
76+ } ,
77+ } ,
7478 {
7579 path : '/verify' ,
7680 name : 'verify' ,
Original file line number Diff line number Diff line change 1+ /**
2+ * Centralized utility for checking if user registration is enabled.
3+ * Registration is disabled for the production deployment at eduquilt.com
4+ * to restrict access to testing/family use only.
5+ */
6+
7+ const REGISTRATION_DISABLED_HOSTS = new Set ( [
8+ 'eduquilt.com' ,
9+ 'www.eduquilt.com' ,
10+ ] ) ;
11+
12+ export function isRegistrationEnabled ( ) : boolean {
13+ try {
14+ const url = new URL ( window . location . href ) ;
15+ return ! REGISTRATION_DISABLED_HOSTS . has ( url . hostname ) ;
16+ } catch {
17+ // If URL parsing fails, default to allowing registration (safer fallback)
18+ return true ;
19+ }
20+ }
You can’t perform that action at this time.
0 commit comments