Skip to content

Commit 91315a7

Browse files
author
David Inga
committed
added support for applications
1 parent af8d229 commit 91315a7

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Diff for: lib/auth.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ function Strategy(options = {}) {
99
passport.Strategy.call(this);
1010
this.controlTowerUrl = options.controlTowerUrl;
1111
this.callbackUrl = options.callbackUrl;
12+
this.applications = options.applications;
1213
}
1314

1415
// Inherits from Passport Strategy
@@ -67,11 +68,11 @@ Strategy.prototype.verify = function verify(userToken, done) {
6768
};
6869

6970
Strategy.prototype.login = function login(req, res) {
70-
res.redirect(`${this.controlTowerUrl}/auth?callbackUrl=${this.callbackUrl}&token=true`);
71+
res.redirect(`${this.controlTowerUrl}/auth?callbackUrl=${this.callbackUrl}&token=true&applications=${this.applications}`);
7172
};
7273

7374
Strategy.prototype.logout = function logout(req, res) {
74-
res.redirect(`${this.controlTowerUrl}/auth/logout?callbackUrl=${this.callbackUrl}&token=true`);
75+
res.redirect(`${this.controlTowerUrl}/auth/logout?callbackUrl=${this.callbackUrl}&token=true&applications=${this.applications}`);
7576
};
7677

7778
Strategy.prototype.error = function error(err) {

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "passport-control-tower",
3-
"version": "0.1.6",
3+
"version": "0.1.8",
44
"description": "A Passport's strategy for Control Tower",
55
"main": "lib/auth.js",
66
"scripts": {

0 commit comments

Comments
 (0)