diff --git a/apps/dispatch/app/(dispatch)/layout.tsx b/apps/dispatch/app/(dispatch)/layout.tsx index 30116e52..feae307f 100644 --- a/apps/dispatch/app/(dispatch)/layout.tsx +++ b/apps/dispatch/app/(dispatch)/layout.tsx @@ -14,7 +14,6 @@ export default async function RootLayout({ children: React.ReactNode; }>) { const session = await getServerSession(); - console.log(session); if (!session) { redirect("/login"); } diff --git a/apps/dispatch/app/_store/connectionStore.ts b/apps/dispatch/app/_store/connectionStore.ts index 1ebfaeaf..1ba1764a 100644 --- a/apps/dispatch/app/_store/connectionStore.ts +++ b/apps/dispatch/app/_store/connectionStore.ts @@ -1,8 +1,6 @@ import { create } from "zustand"; import { socket } from "../(dispatch)/socket"; -console.log("connectionStore"); - interface ConnectionStore { isConnected: boolean; connect: (uid: string) => Promise; diff --git a/apps/hub-server/.env.example b/apps/hub-server/.env.example index b08a718f..959cea51 100644 --- a/apps/hub-server/.env.example +++ b/apps/hub-server/.env.example @@ -1,3 +1,4 @@ +API_PORT= MOODLE_TOKEN= MOODLE_URL= MAIL_SERVER= diff --git a/apps/hub-server/index.ts b/apps/hub-server/index.ts index 7cc534dc..d2e43551 100644 --- a/apps/hub-server/index.ts +++ b/apps/hub-server/index.ts @@ -1,5 +1,17 @@ import "dotenv/config"; import "modules/chron"; +import express from "express"; +import cors from "cors"; +import router from "routes/router"; -// Add API eventually -console.log("VAR hub Server started"); +const app = express(); + +app.use(express.json()); +app.use(cors()); + +app.use(router); + +const port = process.env.API_PORT || 3003; +app.listen(port, () => { + console.log(`Server is running on port ${port}`); +}); diff --git a/apps/hub-server/modules/mail-templates/PasswordChanged.tsx b/apps/hub-server/modules/mail-templates/PasswordChanged.tsx new file mode 100644 index 00000000..5cd48499 --- /dev/null +++ b/apps/hub-server/modules/mail-templates/PasswordChanged.tsx @@ -0,0 +1,202 @@ +import * as React from "react"; +import { User } from "@repo/db"; +import { Html, render } from "@react-email/components"; + +const styles = ` + * { + box-sizing: border-box; + } + + body { + margin: 0; + padding: 0; + } + + a[x-apple-data-detectors] { + color: inherit !important; + text-decoration: inherit !important; + } + + #MessageViewBody a { + color: inherit; + text-decoration: none; + } + + p { + line-height: inherit; + } + + .desktop_hide, + .desktop_hide table { + mso-hide: all; + display: none; + max-height: 0px; + overflow: hidden; + } + + .image_block img + div { + display: none; + } + + sup, + sub { + font-size: 75%; + line-height: 0; + } + + .menu_block.desktop_hide .menu-links span { + mso-hide: all; + } + + @media (max-width: 700px) { + .desktop_hide table.icons-inner { + display: inline-block !important; + } + + .icons-inner { + text-align: center; + } + + .icons-inner td { + margin: 0 auto; + } + } +`; + +const Template = ({ user, password }: { user: User; password: string }) => ( + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ Logo +
+ Passwort geändert +
+ Hallo {user.firstname}, +
+ Dein Passwort wurde erfolgreich geändert. Wenn du diese + Änderung nicht vorgenommen hast, kontaktiere bitte sofort + unseren Support. +
+ Dein neues Passwort lautet: {password} +
+ + Impressum + + | + + Datenschutzerklärung + + | + + Knowledgebase + +
+
+ + +); + +export function renderPasswordChanged({ + user, + password, +}: { + user: User; + password: string; +}) { + return render(