diff --git a/apps/web/app/auth/signup/signup.tsx b/apps/web/app/auth/signup/signup.tsx
index 71e977e1..8ed3b064 100644
--- a/apps/web/app/auth/signup/signup.tsx
+++ b/apps/web/app/auth/signup/signup.tsx
@@ -3,7 +3,7 @@ import learnhouseIcon from 'public/learnhouse_bigicon_1.png'
import Image from 'next/image'
import { getOrgLogoMediaDirectory } from '@services/media/media'
import Link from 'next/link'
-import { getUriWithOrg } from '@services/config/config'
+import { getUriWithOrg, getUriWithoutOrg } from '@services/config/config'
import { useLHSession } from '@components/Contexts/LHSessionContext'
import React, { useEffect } from 'react'
import { MailWarning, Ticket, UserPlus } from 'lucide-react'
@@ -191,7 +191,7 @@ const NoTokenScreen = (props: any) => {
"Invite code is valid, you'll be redirected to the signup page in a few seconds"
)
setTimeout(() => {
- router.push(`/signup?inviteCode=${inviteCode}&orgslug=${org.slug}`)
+ router.push(getUriWithoutOrg(`/signup?inviteCode=${inviteCode}&orgslug=${org.slug}`))
}, 2000)
} else {
toast.error('Invite code is invalid')
diff --git a/apps/web/components/Dashboard/Pages/Users/OrgAccess/OrgAccess.tsx b/apps/web/components/Dashboard/Pages/Users/OrgAccess/OrgAccess.tsx
index b5221e66..ae14fe86 100644
--- a/apps/web/components/Dashboard/Pages/Users/OrgAccess/OrgAccess.tsx
+++ b/apps/web/components/Dashboard/Pages/Users/OrgAccess/OrgAccess.tsx
@@ -1,7 +1,7 @@
import { useOrg } from '@components/Contexts/OrgContext'
import PageLoading from '@components/Objects/Loaders/PageLoading'
import ConfirmationModal from '@components/Objects/StyledElements/ConfirmationModal/ConfirmationModal'
-import { getAPIUrl, getUriWithOrg } from '@services/config/config'
+import { getAPIUrl, getUriWithOrg, getUriWithoutOrg } from '@services/config/config'
import { swrFetcher } from '@services/utils/ts/requests'
import { Globe, Ticket, UserSquare, Users, X } from 'lucide-react'
import Link from 'next/link'
@@ -173,14 +173,12 @@ function OrgAccess() {
- {getUriWithOrg(
- org?.slug,
- `/signup?inviteCode=${invite.invite_code}`
+ {getUriWithoutOrg(
+ `/signup?inviteCode=${invite.invite_code}&orgslug=${org.slug}`
)}
diff --git a/apps/web/components/Objects/Courses/CourseActions/CoursesActions.tsx b/apps/web/components/Objects/Courses/CourseActions/CoursesActions.tsx
index bbcabe0d..2d69cdb8 100644
--- a/apps/web/components/Objects/Courses/CourseActions/CoursesActions.tsx
+++ b/apps/web/components/Objects/Courses/CourseActions/CoursesActions.tsx
@@ -6,7 +6,7 @@ import { revalidateTags } from '@services/utils/ts/requests'
import { useRouter } from 'next/navigation'
import { useLHSession } from '@components/Contexts/LHSessionContext'
import { useMediaQuery } from 'usehooks-ts'
-import { getUriWithOrg } from '@services/config/config'
+import { getUriWithOrg, getUriWithoutOrg } from '@services/config/config'
import { getProductsByCourse } from '@services/payments/products'
import { LogIn, LogOut, ShoppingCart, AlertCircle } from 'lucide-react'
import Modal from '@components/Objects/StyledElements/Modal/Modal'
@@ -126,7 +126,7 @@ const Actions = ({ courseuuid, orgslug, course }: CourseActionsProps) => {
const handleCourseAction = async () => {
if (!session.data?.user) {
- router.push(getUriWithOrg(orgslug, '/signup?orgslug=' + orgslug))
+ router.push(getUriWithoutOrg(`/signup?orgslug=${orgslug}`))
return
}
const action = isStarted ? removeCourse : startCourse
diff --git a/apps/web/components/Security/AdminAuthorization.tsx b/apps/web/components/Security/AdminAuthorization.tsx
index 7840317f..7afdefe8 100644
--- a/apps/web/components/Security/AdminAuthorization.tsx
+++ b/apps/web/components/Security/AdminAuthorization.tsx
@@ -4,6 +4,8 @@ import { useLHSession } from '@components/Contexts/LHSessionContext';
import useAdminStatus from '@components/Hooks/useAdminStatus';
import { usePathname, useRouter } from 'next/navigation';
import PageLoading from '@components/Objects/Loaders/PageLoading';
+import { getUriWithoutOrg } from '@services/config/config';
+import { useOrg } from '@components/Contexts/OrgContext';
type AuthorizationProps = {
children: React.ReactNode;
@@ -22,6 +24,7 @@ const ADMIN_PATHS = [
const AdminAuthorization: React.FC = ({ children, authorizationMode }) => {
const session = useLHSession() as any;
+ const org = useOrg() as any;
const pathname = usePathname();
const router = useRouter();
const { isAdmin, loading } = useAdminStatus() as any
@@ -51,7 +54,7 @@ const AdminAuthorization: React.FC = ({ children, authorizat
}
if (!isUserAuthenticated) {
- router.push('/login');
+ router.push(getUriWithoutOrg('/login?orgslug=' + org.slug));
return;
}
diff --git a/apps/web/components/Security/HeaderProfileBox.tsx b/apps/web/components/Security/HeaderProfileBox.tsx
index 6fbddd2b..f61d875d 100644
--- a/apps/web/components/Security/HeaderProfileBox.tsx
+++ b/apps/web/components/Security/HeaderProfileBox.tsx
@@ -25,10 +25,10 @@ export const HeaderProfileBox = () => {
-
Login
+ href={{ pathname: getUriWithoutOrg('/login?orgslug=' + org.slug), query: org ? { orgslug: org.slug } : null }} >Login
-
- Sign up
+ Sign up