From e2066f51523ecba0f1991edd0c2b94f8f4cd1820 Mon Sep 17 00:00:00 2001 From: "Alex Pooley (@zuedev)" Date: Sun, 24 May 2026 12:58:49 +0100 Subject: shorten community subdirs --- .../174bg.net/src/app/api/auth/[...all]/route.js | 4 ++ communities/174bg/174bg.net/src/app/globals.css | 8 ++++ communities/174bg/174bg.net/src/app/layout.js | 31 +++++++++++++ communities/174bg/174bg.net/src/app/login/page.js | 51 ++++++++++++++++++++++ communities/174bg/174bg.net/src/app/page.js | 17 ++++++++ .../174bg.net/src/app/secure/discord-data/page.js | 24 ++++++++++ communities/174bg/174bg.net/src/app/secure/page.js | 13 ++++++ 7 files changed, 148 insertions(+) create mode 100644 communities/174bg/174bg.net/src/app/api/auth/[...all]/route.js create mode 100644 communities/174bg/174bg.net/src/app/globals.css create mode 100644 communities/174bg/174bg.net/src/app/layout.js create mode 100644 communities/174bg/174bg.net/src/app/login/page.js create mode 100644 communities/174bg/174bg.net/src/app/page.js create mode 100644 communities/174bg/174bg.net/src/app/secure/discord-data/page.js create mode 100644 communities/174bg/174bg.net/src/app/secure/page.js (limited to 'communities/174bg/174bg.net/src/app') diff --git a/communities/174bg/174bg.net/src/app/api/auth/[...all]/route.js b/communities/174bg/174bg.net/src/app/api/auth/[...all]/route.js new file mode 100644 index 0000000..2aabedd --- /dev/null +++ b/communities/174bg/174bg.net/src/app/api/auth/[...all]/route.js @@ -0,0 +1,4 @@ +import { auth } from "@/auth"; +import { toNextJsHandler } from "better-auth/next-js"; + +export const { POST, GET } = toNextJsHandler(auth); diff --git a/communities/174bg/174bg.net/src/app/globals.css b/communities/174bg/174bg.net/src/app/globals.css new file mode 100644 index 0000000..fa3342d --- /dev/null +++ b/communities/174bg/174bg.net/src/app/globals.css @@ -0,0 +1,8 @@ +@import "tailwindcss"; + +@theme inline { + --color-background: var(--background); + --color-foreground: var(--foreground); + --font-sans: var(--font-inter); + --font-mono: var(--font-fira-code); +} diff --git a/communities/174bg/174bg.net/src/app/layout.js b/communities/174bg/174bg.net/src/app/layout.js new file mode 100644 index 0000000..9fb4098 --- /dev/null +++ b/communities/174bg/174bg.net/src/app/layout.js @@ -0,0 +1,31 @@ +import { Inter, Fira_Code } from "next/font/google"; +import "./globals.css"; + +const inter = Inter({ + variable: "--font-inter", + subsets: ["latin"], +}); + +const firaCode = Fira_Code({ + variable: "--font-fira-code", + subsets: ["latin"], +}); + +export const metadata = { + title: "174th Battle Group", + description: "Vengeance Within Reach", + icons: { + icon: "/favicon.png", + }, +}; + +export default function RootLayout({ children }) { + return ( + + {children} + + ); +} diff --git a/communities/174bg/174bg.net/src/app/login/page.js b/communities/174bg/174bg.net/src/app/login/page.js new file mode 100644 index 0000000..b2b1ea8 --- /dev/null +++ b/communities/174bg/174bg.net/src/app/login/page.js @@ -0,0 +1,51 @@ +"use client"; + +import { Suspense, useEffect, useState } from "react"; +import { useSearchParams } from "next/navigation"; +import { authClient } from "@/lib/auth-client"; + +function LoginRedirect() { + const searchParams = useSearchParams(); + const callbackUrl = searchParams.get("callbackUrl") ?? "/secure"; + const [error, setError] = useState(null); + + const signIn = () => { + authClient.signIn + .social({ + provider: "discord", + callbackURL: callbackUrl, + }) + .then(({ error }) => { + if (error) setError(error.message ?? "Sign-in failed"); + }); + }; + + useEffect(() => { + signIn(); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + + if (error) { + return ( +
+

Error: {error}

+ +
+ ); + } + + return ( +
+

Redirecting to Discord...

+ +
+ ); +} + +export default function LoginPage() { + return ( + Loading...

}> + +
+ ); +} diff --git a/communities/174bg/174bg.net/src/app/page.js b/communities/174bg/174bg.net/src/app/page.js new file mode 100644 index 0000000..9aaf53a --- /dev/null +++ b/communities/174bg/174bg.net/src/app/page.js @@ -0,0 +1,17 @@ +export default function Home() { + return ( +
+

The 174th Battle Group

+

+ "Vengeance Within Reach" +

+

+ The 174th Battle Group is a logistical support unit of the United Earth + Empire's military. It is responsible for providing logistical support to + the UEE's forces, including transportation, supply, and maintenance. The + 174th Battle Group is known for its efficiency and reliability, and it + has played a crucial role in many of the UEE's military campaigns. +

+
+ ); +} diff --git a/communities/174bg/174bg.net/src/app/secure/discord-data/page.js b/communities/174bg/174bg.net/src/app/secure/discord-data/page.js new file mode 100644 index 0000000..b906569 --- /dev/null +++ b/communities/174bg/174bg.net/src/app/secure/discord-data/page.js @@ -0,0 +1,24 @@ +import { auth } from "@/auth"; +import { headers } from "next/headers"; + +export default async function DiscordData() { + const session = await auth.api.getSession({ headers: await headers() }); + const accounts = await auth.api.listUserAccounts({ + headers: await headers(), + }); + const discordAccount = accounts?.find((a) => a.provider === "discord"); + + return ( +
+

Discord Data

+

The following data is stored about your Discord account:

+
+        {JSON.stringify(
+          { user: session?.user, account: discordAccount },
+          null,
+          2,
+        )}
+      
+
+ ); +} diff --git a/communities/174bg/174bg.net/src/app/secure/page.js b/communities/174bg/174bg.net/src/app/secure/page.js new file mode 100644 index 0000000..27312b7 --- /dev/null +++ b/communities/174bg/174bg.net/src/app/secure/page.js @@ -0,0 +1,13 @@ +import { auth } from "@/auth"; +import { headers } from "next/headers"; + +export default async function SecurePage() { + const session = await auth.api.getSession({ headers: await headers() }); + + return ( +
+

Secure Area

+

Welcome, {session?.user?.name ?? session?.user?.email}!

+
+ ); +} -- cgit v1.2.3