@openneuro/server 4.17.0 → 4.17.2

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": "@openneuro/server",
3
- "version": "4.17.0",
3
+ "version": "4.17.2",
4
4
  "description": "Core service for the OpenNeuro platform.",
5
5
  "license": "MIT",
6
6
  "main": "src/server.js",
@@ -17,7 +17,7 @@
17
17
  "dependencies": {
18
18
  "@apollo/client": "3.7.2",
19
19
  "@elastic/elasticsearch": "7.15.0",
20
- "@openneuro/search": "^4.17.0",
20
+ "@openneuro/search": "^4.17.2",
21
21
  "@passport-next/passport-google-oauth2": "^1.0.0",
22
22
  "@sentry/node": "^4.5.3",
23
23
  "apollo-server": "2.25.4",
@@ -92,5 +92,5 @@
92
92
  "publishConfig": {
93
93
  "access": "public"
94
94
  },
95
- "gitHead": "2a6d05304f3927dc0d1896d5988ffddcaa4b5c3c"
95
+ "gitHead": "7e0baf02f32539a1ca3c2bf146e9e5f7ba437854"
96
96
  }
@@ -21,16 +21,16 @@ export const authCallback = (req, res, next) =>
21
21
  const existingAuth = parsedJwtFromRequest(req)
22
22
  if (existingAuth) {
23
23
  // Save ORCID to primary account
24
- User.findOne({ id: existingAuth.sub }, (err, userModel) => {
25
- if (err) {
26
- return next(err)
27
- } else {
24
+ User.findOne({ id: existingAuth.sub })
25
+ .then(userModel => {
28
26
  userModel.orcid = user.providerId
29
27
  return userModel.save().then(() => {
30
28
  res.redirect('/')
31
29
  })
32
- }
33
- })
30
+ })
31
+ .catch(err => {
32
+ return next(err)
33
+ })
34
34
  } else {
35
35
  // Complete login with ORCID as primary account
36
36
  req.logIn(user, { session: false }, err => {