Skip to content

Commit

Permalink
Merge pull request #121 from AsliSema/fronend-update-links
Browse files Browse the repository at this point in the history
updated api docs and google links
  • Loading branch information
nourkrimesh authored Aug 10, 2023
2 parents faf556b 33d7f61 commit 564ae75
Show file tree
Hide file tree
Showing 3 changed files with 242 additions and 454 deletions.
2 changes: 0 additions & 2 deletions src/db/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 12,8 @@ const connectToDatabase = async () => {
else {
mongoURI = config.mongo.devDB.url;
}
console.log('1: trying to connect to database with connStr:', mongoURI);
if (mongoURI !== undefined) {
try {
console.log('2: trying to connect to database with connStr:', mongoURI);
await mongoose.connect(mongoURI, {
useNewUrlParser: true,
useUnifiedTopology: true,
Expand Down
15 changes: 8 additions & 7 deletions src/routes/googleAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 11,14 @@ router.route("/google").get(passport.authenticate("google", {

router.get("/google/callback", passport.authenticate("google", { failureRedirect: '/', session: false }), (req: Request, res: Response) => {
// res.send("You have been signed in successfully! You will be redirected to Home");
res.send({
_id: req.user._id,
firstname: req.user.firstname,
lastname: req.user.lastname,
email: req.user.email,
token: generateToken(req.user._id),
});
// res.send({
// _id: req.user._id,
// firstname: req.user.firstname,
// lastname: req.user.lastname,
// email: req.user.email,
// token: generateToken(req.user._id),
// });
res.render('home');
});


Expand Down
Loading

0 comments on commit 564ae75

Please sign in to comment.