From c9449db0bba5e0d45fcdbdfcefe143c719f071ad Mon Sep 17 00:00:00 2001 From: AMAICDAX Date: Tue, 9 Sep 2025 15:30:31 +0200 Subject: [PATCH] modif --- controllers/linkedin.js | 3 ++- routes/api.routes.js | 3 --- routes/front.routes.js | 10 +++++++++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/controllers/linkedin.js b/controllers/linkedin.js index 2e9f141..e711b96 100644 --- a/controllers/linkedin.js +++ b/controllers/linkedin.js @@ -44,7 +44,8 @@ const handleCallback = async (req, res) => { accessToken, }; - res.send("Authentication successful! User session created."); + // Redirige vers /profile après authentification + res.redirect("/profile"); } catch (error) { console.error( "LinkedIn token error:", diff --git a/routes/api.routes.js b/routes/api.routes.js index 5c8e2c8..31b83d9 100644 --- a/routes/api.routes.js +++ b/routes/api.routes.js @@ -14,7 +14,4 @@ router.get("/auth/linkedin", authenticateUser); // Callback route for LinkedIn OAuth2 router.get("/auth/linkedin/callback", handleCallback); -// Route for fetching user profile information -router.get("/profile", getUserProfile); - module.exports = router; diff --git a/routes/front.routes.js b/routes/front.routes.js index ea46e94..08d2c4a 100644 --- a/routes/front.routes.js +++ b/routes/front.routes.js @@ -4,7 +4,15 @@ const express = require("express"); const router = express.Router(); router.get("/", (req, res) => { - res.send("Welcome to the CV Generator Home Page!"); + res.send(` +

Welcome to the CV Generator Home Page!

+ + + + `); }); +// Route for fetching user profile information +router.get("/profile", getUserProfile); + module.exports = router;