@openneuro/server 4.4.10 → 4.5.0

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.4.10",
3
+ "version": "4.5.0",
4
4
  "description": "Core service for the OpenNeuro platform.",
5
5
  "license": "MIT",
6
6
  "main": "src/server.js",
@@ -104,5 +104,5 @@
104
104
  "publishConfig": {
105
105
  "access": "public"
106
106
  },
107
- "gitHead": "d3e7a6459132b92d678665a081efd666e3088461"
107
+ "gitHead": "8771d59f40e642de9313468e8764f91fb0d811b2"
108
108
  }
@@ -44,7 +44,9 @@ const publishPermissions = async datasetId => {
44
44
  export const updatePermissions = async (obj, args, { user, userInfo }) => {
45
45
  await checkDatasetAdmin(args.datasetId, user, userInfo)
46
46
  // get all users the the email specified by permissions arg
47
- const users = await User.find({ email: args.userEmail }).exec()
47
+ const users = await User.find({ email: args.userEmail })
48
+ .collation({ locale: 'en', strength: 2 })
49
+ .exec()
48
50
 
49
51
  if (!users.length) {
50
52
  throw new Error('A user with that email address does not exist')
@@ -29,6 +29,16 @@ const userSchema = new Schema({
29
29
  })
30
30
 
31
31
  userSchema.index({ id: 1, provider: 1 }, { unique: true })
32
+ // Allow case insensitive email queries
33
+ userSchema.index(
34
+ { email: 1 },
35
+ {
36
+ collation: {
37
+ locale: 'en',
38
+ strength: 2,
39
+ },
40
+ },
41
+ )
32
42
 
33
43
  const User = model<UserDocument>('User', userSchema)
34
44