wiki-security-passportjs 0.11.2 → 0.11.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wiki-security-passportjs",
3
- "version": "0.11.2",
3
+ "version": "0.11.3",
4
4
  "description": "Security plugin for Federated Wiki, using passport.js",
5
5
  "author": "Paul Rodwell <paul.rodwell@btinternet.com> (http://rodwell.me)",
6
6
  "license": "MIT",
@@ -15,7 +15,6 @@ https = require 'https'
15
15
  url = require 'url'
16
16
 
17
17
  _ = require 'lodash'
18
- glob = require 'glob'
19
18
 
20
19
  { jwtDecode } = require('jwt-decode');
21
20
 
@@ -165,12 +164,12 @@ module.exports = exports = (log, loga, argv) ->
165
164
  oauth2StrategyName = callbackHost + 'OAuth'
166
165
 
167
166
  if argv.oauth2_UserInfoURL?
168
- OAuth2Strategy::userProfile = (accesstoken, done) ->
167
+ OAuth2Strategy::userProfile = (accesstoken, done) ->
169
168
  @_oauth2._request "GET", argv.oauth2_UserInfoURL, null, null, accesstoken, (err, data) ->
170
169
  if err
171
- return done err
170
+ return done err
172
171
  try
173
- data = JSON.parse data
172
+ data = JSON.parse data
174
173
  catch e
175
174
  return done e
176
175
  done(null, data)
@@ -203,14 +202,14 @@ module.exports = exports = (log, loga, argv) ->
203
202
  else
204
203
  console.error('*** source of user info not recognised', uiPath)
205
204
  obj = {}
206
-
205
+
207
206
  while (sParts.length)
208
207
  obj = obj[sParts.shift()]
209
208
  return obj
210
209
 
211
210
  if argv.oauth2_UsernameField?
212
- username_query = argv.oauth2_UsernameField
213
- else
211
+ username_query = argv.oauth2_UsernameField
212
+ else
214
213
  username_query = 'params.user_id'
215
214
 
216
215
  try
@@ -283,7 +282,7 @@ module.exports = exports = (log, loga, argv) ->
283
282
  clientSecret: argv.google_clientSecret
284
283
  callbackURL: callbackProtocol + '//' + callbackHost + '/auth/google/callback'
285
284
  }, (accessToken, refreshToken, profile, cb) ->
286
- user = { google: {
285
+ user = { google: {
287
286
  id: profile.id
288
287
  displayName: profile.displayName
289
288
  emails: profile.emails