Fixed docker deploments, moved files to _folders in dispatch app

This commit is contained in:
PxlLoewe
2025-05-27 17:34:44 -07:00
parent 5d5b2dc91f
commit 571ddfba85
60 changed files with 251 additions and 406 deletions

View File

@@ -27,14 +27,14 @@ export const options: AuthOptions = {
},
}),
],
secret: process.env.NEXTAUTH_SECRET,
secret: process.env.AUTH_HUB_SECRET,
session: {
strategy: "jwt",
maxAge: 30 * 24 * 60 * 60,
},
cookies: {
sessionToken: {
name: `${process.env.NEXTAUTH_COOKIE_PREFIX}-next-auth.session-token`, // Ändere den Namen für App 1
name: `${process.env.AUTH_HUB_COOKIE_PREFIX}-next-auth.session-token`, // Ändere den Namen für App 1
options: {
httpOnly: true,
secure: process.env.NODE_ENV === "production",
@@ -42,7 +42,7 @@ export const options: AuthOptions = {
},
},
csrfToken: {
name: `${process.env.NEXTAUTH_COOKIE_PREFIX}-next-auth.csrf-token`,
name: `${process.env.AUTH_HUB_COOKIE_PREFIX}-next-auth.csrf-token`,
options: {
httpOnly: true,
secure: process.env.NODE_ENV === "production",

View File

@@ -60,7 +60,7 @@ export const POST = async (req: NextRequest) => {
{
...accessRequest.user,
},
process.env.NEXTAUTH_SECRET as string,
process.env.AUTH_HUB_SECRET as string,
{
expiresIn: "30d",
},

View File

@@ -11,7 +11,7 @@ export const GET = async (req: NextRequest) => {
if (!authHeader || !token) {
return NextResponse.json({ error: "Not logged in" }, { status: 401 });
}
const decoded = await verify(token, process.env.NEXTAUTH_SECRET as string);
const decoded = await verify(token, process.env.AUTH_HUB_SECRET as string);
if (typeof decoded === "string")
return NextResponse.json({ error: "Invalid token" }, { status: 401 });
@@ -22,8 +22,7 @@ export const GET = async (req: NextRequest) => {
},
});
if (!user)
return NextResponse.json({ error: "User not found" }, { status: 404 });
if (!user) return NextResponse.json({ error: "User not found" }, { status: 404 });
setTimeout(async () => {
const moodleUser = await getMoodleUserById(user.id);
await prisma.user.update({
@@ -49,10 +48,7 @@ export const GET = async (req: NextRequest) => {
},
});
participatingEvents.forEach(async (p) => {
await inscribeToMoodleCourse(
p.Event.finisherMoodleCourseId!,
moodleUser?.id,
);
await inscribeToMoodleCourse(p.Event.finisherMoodleCourseId!, moodleUser?.id);
});
}, 1000);