@tiledesk/tiledesk-server 2.4.42 → 2.4.43
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/routes/auth.js +14 -1
package/package.json
CHANGED
package/routes/auth.js
CHANGED
@@ -458,13 +458,23 @@ function (req, res) {
|
|
458
458
|
|
459
459
|
// http://localhost:3000/auth/google?redirect_url=%2F%23%2Fproject%2F6452281f6d68c5f419c1c577%2Fhome
|
460
460
|
|
461
|
+
// http://localhost:3000/auth/google?redirect_url=%23%2Fcreate-project-gs
|
461
462
|
|
463
|
+
// http://localhost:3000/auth/google?forced_redirect_url=https%3A%2F%2Fpanel.tiledesk.com%2Fv3%2Fchat%2F%23conversation-detail%3Ffrom%3Dgoogle
|
464
|
+
|
465
|
+
// https://tiledesk-server-pre.herokuapp.com/auth/google?redirect_url=%23%2Fcreate-project-gs
|
466
|
+
|
467
|
+
// https://tiledesk-server-pre.herokuapp.com/auth/google
|
462
468
|
|
463
469
|
// Redirect the user to the Google signin page</em>
|
464
470
|
// router.get("/google", passport.authenticate("google", { scope: ["email", "profile"] }));
|
465
471
|
router.get("/google", function(req,res,next){
|
466
472
|
winston.info("redirect_url: "+ req.query.redirect_url );
|
467
473
|
req.session.redirect_url = req.query.redirect_url;
|
474
|
+
|
475
|
+
winston.info("forced_redirect_url: "+ req.query.forced_redirect_url );
|
476
|
+
req.session.forced_redirect_url = req.query.forced_redirect_url;
|
477
|
+
|
468
478
|
// req._toParam = 'Hello';
|
469
479
|
passport.authenticate(
|
470
480
|
// 'google', { scope : ["email", "profile"], state: base64url(JSON.stringify({blah: 'text'})) } //custom redirect_url req.query.state
|
@@ -487,7 +497,7 @@ router.get("/google/callback", passport.authenticate("google", { session: false
|
|
487
497
|
// winston.info("req._toParam: "+ req._toParam);
|
488
498
|
// winston.info("req.query.redirect_url: "+ req.query.redirect_url);
|
489
499
|
// winston.info("req.query.state: "+ req.query.state);
|
490
|
-
winston.
|
500
|
+
winston.debug("req.session.redirect_url: "+ req.session.redirect_url);
|
491
501
|
|
492
502
|
|
493
503
|
var userJson = user.toObject();
|
@@ -526,6 +536,9 @@ router.get("/google/callback", passport.authenticate("google", { session: false
|
|
526
536
|
|
527
537
|
var url = dashboard_base_url+homeurl+"?token=JWT "+token;
|
528
538
|
|
539
|
+
if (req.session.forced_redirect_url) {
|
540
|
+
url = req.session.forced_redirect_url+"&token=JWT "+token;
|
541
|
+
}
|
529
542
|
|
530
543
|
winston.info("Google Redirect: "+ url);
|
531
544
|
|