Skip to content
This repository was archived by the owner on Apr 6, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/auth/lib/signIn.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const uuid = require('uuid/v4')
const querystring = require('querystring')
const isEmail = require('isemail').validate
const validator = require('validator')
const kraut = require('kraut')
const geoForIP = require('./geoForIP')
const checkEnv = require('check-env')
Expand Down Expand Up @@ -29,7 +29,7 @@ module.exports = async (_email, context, pgdb, req) => {
return {phrase: ''}
}

if (!isEmail(_email)) {
if (!validator.isEmail(_email)) {
debug('invalid email: %O', {
req: req._log(),
_email
Expand Down
4 changes: 2 additions & 2 deletions packages/auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
"export-files": "^2.1.1",
"express-session": "^1.15.6",
"geoip-database": "^1.0.11",
"isemail": "^3.1.1",
"is-uuid": "^1.0.2",
"kraut": "^0.1.1",
"maxmind": "^2.4.0",
Expand All @@ -47,7 +46,8 @@
"querystring": "^0.2.0",
"rw": "^1.3.3",
"useragent": "^2.2.1",
"uuid": "^3.1.0"
"uuid": "^3.1.0",
"validator": "^9.4.1"
},
"peerDependencies": {
"d3-array": "^1.2.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const isEmail = require('isemail').validate
const validator = require('validator')
const { Roles, ensureSignedIn } = require('@orbiting/backend-modules-auth')
const updateUserEmail = require('../../../lib/updateUserEmail')

Expand All @@ -10,7 +10,7 @@ module.exports = async (_, args, { pgdb, user: me, req, t }) => {
email
} = args

if (!isEmail(email)) {
if (!validator.isEmail(email)) {
console.info('invalid email', { req: req._log(), email })
throw new Error(t('api/email/invalid'))
}
Expand Down
16 changes: 5 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
express-session "^1.15.6"
geoip-database "^1.0.11"
is-uuid "^1.0.2"
isemail "^3.1.1"
kraut "^0.1.1"
maxmind "^2.4.0"
passport "^0.4.0"
Expand All @@ -39,6 +38,7 @@
rw "^1.3.3"
useragent "^2.2.1"
uuid "^3.1.0"
validator "^9.4.1"

"@orbiting/backend-modules-base@link:packages/base":
version "1.4.2"
Expand Down Expand Up @@ -3346,12 +3346,6 @@ isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"

isemail@^3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/isemail/-/isemail-3.1.1.tgz#e8450fe78ff1b48347db599122adcd0668bd92b5"
dependencies:
punycode "2.x.x"

isexe@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
Expand Down Expand Up @@ -4929,10 +4923,6 @@ punycode@1.3.2:
version "1.3.2"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d"

punycode@2.x.x:
version "2.1.0"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.0.tgz#5f863edc89b96db09074bad7947bf09056ca4e7d"

punycode@^1.4.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
Expand Down Expand Up @@ -6483,6 +6473,10 @@ validate-npm-package-license@^3.0.1:
spdx-correct "~1.0.0"
spdx-expression-parse "~1.0.0"

validator@^9.4.1:
version "9.4.1"
resolved "https://registry.yarnpkg.com/validator/-/validator-9.4.1.tgz#abf466d398b561cd243050112c6ff1de6cc12663"

vary@^1, vary@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"
Expand Down