From 55e44d9cde89384e689a634b21a1325307113094 Mon Sep 17 00:00:00 2001 From: PxlLoewe <72106766+PxlLoewe@users.noreply.github.com> Date: Sun, 1 Jun 2025 10:26:10 -0700 Subject: [PATCH] Email footer rework --- .../modules/mail-templates/ConfirmEmail.tsx | 39 +----------------- .../mail-templates/CourseCompleted.tsx | 39 +----------------- .../modules/mail-templates/EmailFooter.tsx | 41 +++++++++++++++++++ .../mail-templates/PasswordChanged.tsx | 39 +----------------- apps/hub-server/tsconfig.json | 2 +- apps/hub/app/api/auth/[...nextauth]/auth.ts | 10 +---- 6 files changed, 49 insertions(+), 121 deletions(-) create mode 100644 apps/hub-server/modules/mail-templates/EmailFooter.tsx diff --git a/apps/hub-server/modules/mail-templates/ConfirmEmail.tsx b/apps/hub-server/modules/mail-templates/ConfirmEmail.tsx index 6030a2fd..c06ac6de 100644 --- a/apps/hub-server/modules/mail-templates/ConfirmEmail.tsx +++ b/apps/hub-server/modules/mail-templates/ConfirmEmail.tsx @@ -1,6 +1,7 @@ import * as React from "react"; import { User } from "@repo/db"; import { Html, render } from "@react-email/components"; +import { EmailFooter } from "./EmailFooter"; const styles = ` * { @@ -183,43 +184,7 @@ const Template = ({ user, code }: { user: User; code: string }) => ( - - - Impressum - - | - - Datenschutzerklärung - - | - - Knowledgebase - - + diff --git a/apps/hub-server/modules/mail-templates/CourseCompleted.tsx b/apps/hub-server/modules/mail-templates/CourseCompleted.tsx index 66fd6d88..e09953da 100644 --- a/apps/hub-server/modules/mail-templates/CourseCompleted.tsx +++ b/apps/hub-server/modules/mail-templates/CourseCompleted.tsx @@ -2,6 +2,7 @@ import * as React from "react"; import { Event, User } from "@repo/db"; import { Html, Button, render } from "@react-email/components"; import { Badge } from "./Badge"; +import { EmailFooter } from "./EmailFooter"; const styles = ` * { @@ -132,43 +133,7 @@ const Template = ({ event, user }: { user: User; event: Event }) => ( - - - Impressum - - | - - Datenschutzerklärung - - | - - Knowledgebase - - + diff --git a/apps/hub-server/modules/mail-templates/EmailFooter.tsx b/apps/hub-server/modules/mail-templates/EmailFooter.tsx new file mode 100644 index 00000000..06d00136 --- /dev/null +++ b/apps/hub-server/modules/mail-templates/EmailFooter.tsx @@ -0,0 +1,41 @@ +export const EmailFooter = () => { + return ( + + + Impressum + + | + + Datenschutzerklärung + + | + + Knowledgebase + + + ); +}; diff --git a/apps/hub-server/modules/mail-templates/PasswordChanged.tsx b/apps/hub-server/modules/mail-templates/PasswordChanged.tsx index 5a7bd4da..ea543935 100644 --- a/apps/hub-server/modules/mail-templates/PasswordChanged.tsx +++ b/apps/hub-server/modules/mail-templates/PasswordChanged.tsx @@ -1,6 +1,7 @@ import * as React from "react"; import { User } from "@repo/db"; import { Html, render } from "@react-email/components"; +import { EmailFooter } from "./EmailFooter"; const styles = ` * { @@ -138,43 +139,7 @@ const Template = ({ user, password }: { user: User; password: string }) => ( - - - Impressum - - | - - Datenschutzerklärung - - | - - Knowledgebase - - + diff --git a/apps/hub-server/tsconfig.json b/apps/hub-server/tsconfig.json index 01d715c1..ac895c2a 100644 --- a/apps/hub-server/tsconfig.json +++ b/apps/hub-server/tsconfig.json @@ -4,7 +4,7 @@ "outDir": "dist", "allowImportingTsExtensions": false, "baseUrl": ".", - "jsx": "react" + "jsx": "react-jsx" }, "include": ["**/*.ts", "./index.ts", "modules/mail-templates/VerificationCode.tsx"], "exclude": ["node_modules", "dist"] diff --git a/apps/hub/app/api/auth/[...nextauth]/auth.ts b/apps/hub/app/api/auth/[...nextauth]/auth.ts index bf2d047b..233e33bf 100644 --- a/apps/hub/app/api/auth/[...nextauth]/auth.ts +++ b/apps/hub/app/api/auth/[...nextauth]/auth.ts @@ -69,15 +69,7 @@ export const options: AuthOptions = { }, }); if (!dbUser) { - return { - ...session, - user: { - name: null, - email: null, - image: null, - }, - expires: new Date().toISOString(), - }; + return null as any; } return { ...session,