From 4e2768b7f969ed27746757c8fcfa394be163458f Mon Sep 17 00:00:00 2001 From: Riley Windsor Date: Wed, 13 Nov 2024 19:22:47 -0500 Subject: [PATCH 1/9] fix things --- apps/frontend/auth.ts | 4 ++-- apps/frontend/lib/mongodb.ts | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/apps/frontend/auth.ts b/apps/frontend/auth.ts index d60800c8..57821cac 100644 --- a/apps/frontend/auth.ts +++ b/apps/frontend/auth.ts @@ -1,12 +1,12 @@ import { MongoDBAdapter } from "@auth/mongodb-adapter"; import NextAuth from "next-auth"; import GitHub from "next-auth/providers/github"; -import Keycloak from "next-auth/providers/keycloak"; +// import Keycloak from "next-auth/providers/keycloak"; import clientPromise from "./lib/mongodb" export const { handlers, signIn, signOut, auth } = NextAuth({ adapter: MongoDBAdapter(clientPromise, {databaseName: 'gladosdb'}), - providers: [GitHub, Keycloak], + providers: [GitHub], //Add Keycloak here to do local testing callbacks: { authorized: async ({ auth }) => { // Logged in users are authenticated, otherwise redirect to login page diff --git a/apps/frontend/lib/mongodb.ts b/apps/frontend/lib/mongodb.ts index 7b4e2942..f4d5f8df 100644 --- a/apps/frontend/lib/mongodb.ts +++ b/apps/frontend/lib/mongodb.ts @@ -4,12 +4,11 @@ import { getEnvVar } from '../utils/env'; // Adapted from https://github.com/vercel/next.js/tree/canary/examples/with-mongodb -// const MONGODB_PORT = getEnvVar('MONGODB_PORT'); -// const USERNAME = getEnvVar('MONGODB_USERNAME'); -// const PASSWORD = getEnvVar('MONGODB_PASSWORD'); +const MONGODB_PORT = getEnvVar('MONGODB_PORT'); +const USERNAME = getEnvVar('MONGODB_USERNAME'); +const PASSWORD = getEnvVar('MONGODB_PASSWORD'); -// const MONGODB_URI = `mongodb://${USERNAME}:${PASSWORD}@glados-service-mongodb:${MONGODB_PORT}`; -const MONGODB_URI = 'mongodb://root:password123@137.112.104.86:30000/?directConnection=true'; +const MONGODB_URI = `mongodb://${USERNAME}:${PASSWORD}@glados-service-mongodb:${MONGODB_PORT}`; const MONGODB_OPTIONS = {}; export const DB_NAME = 'gladosdb'; From d2700ed04749d2f6236b45230fc7cf44165acde6 Mon Sep 17 00:00:00 2001 From: Riley Windsor Date: Wed, 13 Nov 2024 19:27:14 -0500 Subject: [PATCH 2/9] Update frontend.Dockerfile --- apps/frontend/frontend.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/frontend/frontend.Dockerfile b/apps/frontend/frontend.Dockerfile index efddc60e..20c37f06 100644 --- a/apps/frontend/frontend.Dockerfile +++ b/apps/frontend/frontend.Dockerfile @@ -17,7 +17,7 @@ FROM node:20-alpine AS base FROM base AS deps RUN apk add --no-cache bash libc6-compat - +WORKDIR /app COPY package.json ./ From 7869cee9a8e5ddedd3f54e629d4c1653278ed28a Mon Sep 17 00:00:00 2001 From: Riley Windsor Date: Wed, 13 Nov 2024 19:52:54 -0500 Subject: [PATCH 3/9] remove google and twitter sign in for now --- apps/frontend/app/components/auth/SignUpModal.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/frontend/app/components/auth/SignUpModal.tsx b/apps/frontend/app/components/auth/SignUpModal.tsx index 1a0d4bd2..5ceae1ee 100644 --- a/apps/frontend/app/components/auth/SignUpModal.tsx +++ b/apps/frontend/app/components/auth/SignUpModal.tsx @@ -42,7 +42,7 @@ export const SignUpModal = ({ afterSignUp }) => {