Skip to content

Commit fd786d8

Browse files
committed
fix: Added firebase login with organization restriction
fix(auth): Made auth using firebase and domain restriction fix: auth feat: added auth
1 parent 87b8b2a commit fd786d8

File tree

21 files changed

+3213
-269
lines changed

21 files changed

+3213
-269
lines changed

backend/.env.sample

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@ DATABASE_URL="postgresql://prisma:prisma@db:5432/exam_bud?schema=public"
66
PORT=4000
77

88
CLOUDINARY_URL=cloudinary://<your_api_key>:<your_api_secret>@<product_environment_name>
9-
CLOUDINARY_PUBLIC_ID=<product_environment_name>
9+
CLOUDINARY_PUBLIC_ID=<product_environment_name>
10+
11+
# Firebase Configuration
12+
FIREBASE_PROJECT_ID=<your_firebase_project_id>
13+
FIREBASE_SERVICE_ACCOUNT_KEY_PATH=<your_firebase_service_account_key_path>

backend/.env.test

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,8 @@ NODE_ENV=test
99
PORT=4000
1010

1111
CLOUDINARY_URL=cloudinary://<your_api_key>:<your_api_secret>@<product_environment_name>
12-
CLOUDINARY_PUBLIC_ID=<product_environment_name>
12+
CLOUDINARY_PUBLIC_ID=<product_environment_name>
13+
14+
# Firebase Configuration
15+
FIREBASE_PROJECT_ID=<your_firebase_project_id>
16+
FIREBASE_SERVICE_ACCOUNT_KEY_PATH=<your_firebase_service_account_key_path>

backend/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules
22
# Keep environment variables out of version control
33
.env
4+
Exam-bud-firebase.json

backend/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ app.use(cors());
99
app.use(express.json());
1010
app.use('/uploads', express.static(path.join(__dirname, 'uploads')));
1111

12-
// dummy auth
13-
app.use(require('./src/middleware/dummyAuth'));
14-
1512
//routes
1613
app.use(require('./src/routes'));
1714

15+
//auth routes
16+
const authRoutes = require('./src/routes/auth');
17+
18+
app.use('/api/auth', authRoutes);
19+
1820
app.listen(process.env.PORT, () =>
1921
console.log(` Backend running on http://localhost:${process.env.PORT}`)
2022
);

0 commit comments

Comments
 (0)