This commit is contained in:
AMAICDAX 2025-09-09 15:30:31 +02:00
parent 8f1bd9e962
commit c9449db0bb
3 changed files with 11 additions and 5 deletions

View file

@ -44,7 +44,8 @@ const handleCallback = async (req, res) => {
accessToken, accessToken,
}; };
res.send("Authentication successful! User session created."); // Redirige vers /profile après authentification
res.redirect("/profile");
} catch (error) { } catch (error) {
console.error( console.error(
"LinkedIn token error:", "LinkedIn token error:",

View file

@ -14,7 +14,4 @@ router.get("/auth/linkedin", authenticateUser);
// Callback route for LinkedIn OAuth2 // Callback route for LinkedIn OAuth2
router.get("/auth/linkedin/callback", handleCallback); router.get("/auth/linkedin/callback", handleCallback);
// Route for fetching user profile information
router.get("/profile", getUserProfile);
module.exports = router; module.exports = router;

View file

@ -4,7 +4,15 @@ const express = require("express");
const router = express.Router(); const router = express.Router();
router.get("/", (req, res) => { router.get("/", (req, res) => {
res.send("Welcome to the CV Generator Home Page!"); res.send(`
<h1>Welcome to the CV Generator Home Page!</h1>
<a href="/api/auth/linkedin">
<button>Connexion LinkedIn</button>
</a>
`);
}); });
// Route for fetching user profile information
router.get("/profile", getUserProfile);
module.exports = router; module.exports = router;