Skip to content

Commit

Permalink
Hack to add accessToken as param to successRedirect. Should be optional
Browse files Browse the repository at this point in the history
TODO: check all cases and make configuration flag
  • Loading branch information
asvdw committed May 14, 2016
1 parent 1e25a09 commit 300579d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
@@ -1,4 +1,5 @@
# loopback-component-passport
** DW FORK: add accessToken param to successredirect (WIP)

**NOTE: This module supersedes [loopback-passport](https://www.npmjs.org/package/loopback-passport). Please update your package.json accordingly.**

Expand Down
8 changes: 6 additions & 2 deletions lib/passport-configurator.js
Expand Up @@ -477,7 +477,9 @@ PassportConfigurator.prototype.configureProvider = function(name, options) {
});
}
}
return res.redirect(successRedirect(req));
// DW: Hack to add accessToken as param. Should be optional
// return res.redirect(successRedirect(req));
return res.redirect(successRedirect(req)+"?access_token="+info.accessToken.id);
});
} else {
if (info && info.accessToken) {
Expand All @@ -497,7 +499,9 @@ PassportConfigurator.prototype.configureProvider = function(name, options) {
});
}
}
return res.redirect(successRedirect(req));
// DW: Hack to add accessToken as param. Should be optional
// return res.redirect(successRedirect(req));
return res.redirect(successRedirect(req)+"?access_token="+info.accessToken.id);
}
})(req, res, next);
};
Expand Down

0 comments on commit 300579d

Please sign in to comment.