Commit ·
93eb97e
1
Parent(s): abe254b
Add missing OAuth start routes for all providers
Browse files- docs/swagger.yaml +1 -1
- server.js +15 -0
docs/swagger.yaml
CHANGED
|
@@ -4,7 +4,7 @@ info:
|
|
| 4 |
version: 1.0.0
|
| 5 |
description: API for Ibrahim Al-Asfar's portfolio website, supporting user authentication, project management, profile handling, and more.
|
| 6 |
servers:
|
| 7 |
-
- url: https://
|
| 8 |
description: Production server
|
| 9 |
- url: http://localhost:3000
|
| 10 |
description: Local development server
|
|
|
|
| 4 |
version: 1.0.0
|
| 5 |
description: API for Ibrahim Al-Asfar's portfolio website, supporting user authentication, project management, profile handling, and more.
|
| 6 |
servers:
|
| 7 |
+
- url: https://mgzon-server.hf.space/
|
| 8 |
description: Production server
|
| 9 |
- url: http://localhost:3000
|
| 10 |
description: Local development server
|
server.js
CHANGED
|
@@ -611,6 +611,21 @@ passport.use(new GitHubStrategy({
|
|
| 611 |
return done(error, null);
|
| 612 |
}
|
| 613 |
}));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 614 |
app.get('/api/csrf-token', (req, res) => {
|
| 615 |
const csrfToken = req.csrfToken ? req.csrfToken() : null;
|
| 616 |
if (!csrfToken) {
|
|
|
|
| 611 |
return done(error, null);
|
| 612 |
}
|
| 613 |
}));
|
| 614 |
+
|
| 615 |
+
app.get('/auth/github',
|
| 616 |
+
passport.authenticate('github', { scope: ['user:email', 'repo'] })
|
| 617 |
+
);
|
| 618 |
+
|
| 619 |
+
// مسار بدء تسجيل الدخول عبر Facebook
|
| 620 |
+
app.get('/auth/facebook',
|
| 621 |
+
passport.authenticate('facebook', { scope: ['email', 'public_profile'] })
|
| 622 |
+
);
|
| 623 |
+
|
| 624 |
+
// مسار بدء تسجيل الدخول عبر MGZon
|
| 625 |
+
app.get('/auth/mgz',
|
| 626 |
+
passport.authenticate('mgzon', { scope: ['profile:read', 'profile:write'] })
|
| 627 |
+
);
|
| 628 |
+
|
| 629 |
app.get('/api/csrf-token', (req, res) => {
|
| 630 |
const csrfToken = req.csrfToken ? req.csrfToken() : null;
|
| 631 |
if (!csrfToken) {
|