+
+
+
+
+
+
Hello, {session?.data?.user.first_name} {session?.data?.user.last_name}
+
Your Organizations
+ {orgs && orgs.length == 0 &&
+
+ It seems you're not part of an organization yet, join one to be able to see it here
+
}
+
+ {orgs && orgs.map((org: any) => (
+
+
{org.name}
+
+
+ ))}
+
+
signOut({ redirect: true, callbackUrl: getUriWithoutOrg('/') })}>Sign out
+
+
+ )
+}
+
+export default HomeClient
\ No newline at end of file
diff --git a/apps/web/app/home/page.tsx b/apps/web/app/home/page.tsx
new file mode 100644
index 00000000..2dd1b5ef
--- /dev/null
+++ b/apps/web/app/home/page.tsx
@@ -0,0 +1,16 @@
+import React from 'react'
+import HomeClient from './home'
+import type { Metadata } from 'next'
+
+export const metadata: Metadata = {
+ title: 'Home',
+}
+function Home() {
+ return (
+ Loading...
+ if (!isOrgActive) return
-
{params.message ? params.message : 'Something went wrong'}
+
+
{params.message ? params.message : 'Something went wrong'}
+
{params.submessage ? params.submessage : ''}
+
-
+
+
+
+ Home
+
)
diff --git a/apps/web/components/StyledElements/Info/Info.tsx b/apps/web/components/StyledElements/Info/Info.tsx
new file mode 100644
index 00000000..45492486
--- /dev/null
+++ b/apps/web/components/StyledElements/Info/Info.tsx
@@ -0,0 +1,37 @@
+'use client'
+import { getUriWithoutOrg } from '@services/config/config'
+import { AlertTriangle, Diamond, Home, PersonStanding, RefreshCcw } from 'lucide-react'
+import Link from 'next/link'
+import React from 'react'
+
+function InfoUI(params: { message?: string, submessage?: string, cta?: string, href: string }) {
+ return (
+
+
+
+
+
{params.message ? params.message : 'Something went wrong'}
+
{params.submessage ? params.submessage : ''}
+
+
+ {params.cta &&
+
+
+
{params.cta}
+
+
+
+
Home
+
+
}
+
+ )
+}
+
+export default InfoUI
diff --git a/apps/web/middleware.ts b/apps/web/middleware.ts
index e32b7a01..47327727 100644
--- a/apps/web/middleware.ts
+++ b/apps/web/middleware.ts
@@ -35,12 +35,24 @@ export default async function middleware(req: NextRequest) {
? fullhost.replace(`.${LEARNHOUSE_DOMAIN}`, '')
: (default_org as string)
+ // Out of orgslug paths & rewrite
+ const standard_paths = ['/home']
+ const auth_paths = ['/login', '/signup', '/reset']
+ if (standard_paths.includes(pathname)) {
+ // Redirect to the same pathname with the original search params
+ return NextResponse.rewrite(new URL(`${pathname}${search}`, req.url))
+ }
+ if (auth_paths.includes(pathname)) {
+ // Redirect to the same pathname with the original search params
+ return NextResponse.rewrite(new URL(`/auth${pathname}${search}`, req.url))
+ }
+
// Login
if (orgslug == 'auth' || pathname.startsWith('/login')) {
return NextResponse.rewrite(new URL(`/login${search}`, req.url))
}
- // Install Page
+ // Install Page (depreceated)
if (pathname.startsWith('/install')) {
// Check if install mode is enabled
const install_mode = await isInstallModeEnabled()
@@ -71,8 +83,7 @@ export default async function middleware(req: NextRequest) {
redirectUrl.search = queryString
}
return NextResponse.redirect(redirectUrl)
- } else{
-
+ } else {
}
}