From 65986b7fbc7d99159359a867c8cd21a13bb58f44 Mon Sep 17 00:00:00 2001
From: Michael Brusegard <56915010+michaelbrusegard@users.noreply.github.com>
Date: Thu, 14 Nov 2024 18:24:52 +0100
Subject: [PATCH] Revert "chore: work on getting locale onthe backend through
headers"
This reverts commit 029fa38162d4af7fea8ac1989b5a72c4c436199e.
---
bun.lockb | Bin 269724 -> 269724 bytes
messages/en.json | 3 +-
messages/no.json | 3 +-
src/app/[locale]/auth/page.tsx | 16 +++-------
src/app/api/auth/feide/route.ts | 1 -
src/app/api/data/[trpc]/route.ts | 6 ++--
.../assets/logos/HackerspaceLogo.tsx | 2 +-
src/components/providers/TRPCProvider.tsx | 3 --
src/lib/api/server.ts | 3 +-
src/server/api/context.ts | 11 +------
src/server/api/locale.ts | 29 +++++++++---------
src/server/api/routers/auth.ts | 7 ++---
src/server/api/trpc.ts | 4 ++-
src/server/api/types.ts | 7 +++++
src/server/auth/feide.ts | 4 +--
15 files changed, 43 insertions(+), 56 deletions(-)
create mode 100644 src/server/api/types.ts
diff --git a/bun.lockb b/bun.lockb
index 30addd66e0b32bee4c7a154c64526a77374aecd1..0f9617aa8a124b9ed35149814756ceca461ca464 100755
GIT binary patch
delta 31
jcmbQUTVT#^frb{wEllN8*_jx?puKJ?)AqWl%yJz7rv(YF
delta 31
ncmbQUTVT#^frb{wEllN8*%{*u_007Q+Uuq=ZLgckEY|@5xjG8}
diff --git a/messages/en.json b/messages/en.json
index 3c0eb10..a1bd925 100644
--- a/messages/en.json
+++ b/messages/en.json
@@ -31,7 +31,8 @@
"error": "Oops! Something went wrong",
"errorDescription": "Don't worry, our best hackers are on it!",
"goToHomepage": "Return to homepage",
- "tryAgain": "Try again"
+ "tryAgain": "Try again",
+ "invalidLocale": "Invalid locale: {locale}"
},
"auth": {
"welcome": "Welcome!",
diff --git a/messages/no.json b/messages/no.json
index 57fa791..dffe67f 100644
--- a/messages/no.json
+++ b/messages/no.json
@@ -31,7 +31,8 @@
"error": "Oops! Noe gikk galt",
"errorDescription": "Ikke bekymre deg, våre beste hackere jobber med saken!",
"goToHomepage": "Gå tilbake til hjemmesiden",
- "tryAgain": "Prøv igjen"
+ "tryAgain": "Prøv igjen",
+ "invalidLocale": "Ugyldig språk: {locale}"
},
"auth": {
"welcome": "Velkommen!",
diff --git a/src/app/[locale]/auth/page.tsx b/src/app/[locale]/auth/page.tsx
index dd2b79a..e64c7e3 100644
--- a/src/app/[locale]/auth/page.tsx
+++ b/src/app/[locale]/auth/page.tsx
@@ -1,11 +1,9 @@
import { FeideLogo } from '@/components/assets/logos/FeideLogo';
import { Button } from '@/components/ui/Button';
import { Separator } from '@/components/ui/Separator';
-import { api } from '@/lib/api/server';
import { Link } from '@/lib/locale/navigation';
import { FingerprintIcon } from 'lucide-react';
import { getTranslations, setRequestLocale } from 'next-intl/server';
-import ExternalLink from 'next/link';
export default async function SignInPage({
params,
@@ -15,23 +13,17 @@ export default async function SignInPage({
const { locale } = await params;
setRequestLocale(locale);
const t = await getTranslations('auth');
- const feideUrlHref = await api.auth.getFeideUrlHref();
return (
-
+
{t('welcome')}
{t('description')}
-
+
{t('signInWith')}
-