Skip to content

Commit

Permalink
Add Dynastic Accounts support (hidden)
Browse files Browse the repository at this point in the history
  • Loading branch information
aydenp committed Jun 24, 2018
1 parent 20908d6 commit 7b47741
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion config/config.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
"trustProxyDepth": 1, // How many levels of proxy to trust for IP
"debug": false,
"googleAnalyticsTrackingID": "", // UA-XXXXXXXX-XX
"host": "http://canvas.place", // the publicly accessible URL of the site
"host": "https://canvas.place", // the publicly accessible URL of the site
"placeTimeout": 60,
'enableChangelogs': true,
'siteName': 'Place',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"cookie-session": "^2.0.0-beta.1",
"csurf": "^1.9.0",
"del": "^2.2.2",
"dynastic-provider": "git+https://github.com:/dynastic/accounts-provider.git",
"dynastic-provider": "dynastic/accounts-provider.git",
"express": "^4.15.2",
"express-brute-mongoose": "0.0.8",
"express-recaptcha": "^2.1.0",
Expand Down
4 changes: 2 additions & 2 deletions routes/oauth.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ function OAuthRouter(app) {
router.get("/microsoft/callback", passport.authenticate("microsoft", { successRedirect: "/?signedin=1", failureRedirect: "/signup" }));
}

if (app.config.oauth.dynastic.enabled) {
router.get('/dynastic', passport.authenticate("dynastic"));
if (app.config.oauth.dynastic && app.config.oauth.dynastic.enabled) {
router.get('/dynastic', passport.authenticate("dynastic", { state: "auth" }));
router.get("/dynastic/callback", passport.authenticate("dynastic", { successRedirect: "/?signedin=1", failureRedirect: "/signup" }));
}
}
Expand Down
6 changes: 3 additions & 3 deletions util/passport.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,13 @@ module.exports = function(passport, app) {
}));
}

if (config.oauth.dynastic.enabled) {
if (config.oauth.dynastic && config.oauth.dynastic.enabled) {
passport.use(new DynasticStrategy({
clientID: config.oauth.dynastic.clientID,
clientSecret: config.oauth.dynastic.clientSecret,
callbackURL: config.host + '/auth/dynastic/callback',
frontendBaseURL: 'https://accounts-staging.dynastic.co',
apiBaseURL: 'https://accounts-api-staging.dynastic.co',
frontendBaseURL: config.oauth.dynastic.frontendBaseURL,
apiBaseURL: config.oauth.dynastic.apiBaseURL,
scope: ['profile']
},
function(accessToken, refreshToken, profile, done) {
Expand Down
14 changes: 7 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1715,9 +1715,9 @@ duplexer2@^0.1.2, duplexer2@~0.1.0, duplexer2@~0.1.2:
dependencies:
readable-stream "^2.0.2"

"dynastic-provider@git+https://github.com:/dynastic/accounts-provider.git":
version "1.0.2"
resolved "git+https://github.com:/dynastic/accounts-provider.git#1478c6273a1701ad27a2b523ebef313d167f74e4"
dynastic-provider@dynastic/accounts-provider.git:
version "1.0.3"
resolved "https://codeload.github.com/dynastic/accounts-provider/tar.gz/d3db068eca6fcf22012833d943e8676e2cbd2eb9"
dependencies:
axios "^0.18.0"
passport-oauth2 "^1.4.0"
Expand Down Expand Up @@ -3875,16 +3875,16 @@ [email protected]:
tar-pack "^3.4.0"

node-pre-gyp@^0.10.0:
version "0.10.1"
resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.1.tgz#d518883e27ebc43161bae86f18400dc2b86b7668"
version "0.10.2"
resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.2.tgz#e8945c20ef6795a20aac2b44f036eb13cf5146e3"
dependencies:
detect-libc "^1.0.2"
mkdirp "^0.5.1"
needle "^2.2.0"
nopt "^4.0.1"
npm-packlist "^1.1.6"
npmlog "^4.0.2"
rc "^1.1.7"
rc "^1.2.7"
rimraf "^2.6.1"
semver "^5.3.0"
tar "^4"
Expand Down Expand Up @@ -4584,7 +4584,7 @@ [email protected]:
iconv-lite "0.4.23"
unpipe "1.0.0"

rc@^1.1.7:
rc@^1.1.7, rc@^1.2.7:
version "1.2.8"
resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed"
dependencies:
Expand Down

0 comments on commit 7b47741

Please sign in to comment.