Skip to content
Snippets Groups Projects
Commit c3edd0d9 authored by Federico Hurtado's avatar Federico Hurtado
Browse files

Redirect to homepage rather than sending JSON response in backend.

parent bec7680b
No related branches found
No related tags found
No related merge requests found
...@@ -4,3 +4,5 @@ DB_USER=corps_directory_dev ...@@ -4,3 +4,5 @@ DB_USER=corps_directory_dev
DB_PASSWORD=corps_db_password DB_PASSWORD=corps_db_password
DB_NAME=corps_directory_db DB_NAME=corps_directory_db
PORT=3000 PORT=3000
FRONTEND_URL=localhost:8080
\ No newline at end of file
...@@ -42,11 +42,9 @@ const casLogin = function (req, res, next) { ...@@ -42,11 +42,9 @@ const casLogin = function (req, res, next) {
// sign the token with secret key // sign the token with secret key
const token = jwt.sign(payload, JWT_SECRET, { expiresIn: "1h" }); const token = jwt.sign(payload, JWT_SECRET, { expiresIn: "1h" });
// send the token to the frontend. // Send the JWT token to the frontend
res.status(200).json({ console.log("sending JWT To: ", process.env.FRONTEND_URL);
message: "successfully authenticated.", res.redirect(`${process.env.FRONTEND_URL}/practice?token=${token}`);
token: "token",
});
console.log("Successfully authenticated and generated token."); console.log("Successfully authenticated and generated token.");
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment