modif
This commit is contained in:
parent
8f1bd9e962
commit
c9449db0bb
3 changed files with 11 additions and 5 deletions
|
|
@ -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:",
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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(`
|
||||
<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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue