mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
fix: remove copy+paste oversights
In the registration resolvers, it makes sense to immediately resolve if an email address has been found (because you can re-send the registration email). In this case, we use the helper method only to trigger the `UserInputError`.
This commit is contained in:
parent
6ffafff288
commit
e6f8bbac9b
@ -7,6 +7,7 @@ import Validator from 'neode/build/Services/Validator.js'
|
||||
export default {
|
||||
Mutation: {
|
||||
AddEmailAddress: async (_parent, args, context, _resolveInfo) => {
|
||||
let response
|
||||
try {
|
||||
const { neode } = context
|
||||
await new Validator(neode, neode.model('UnverifiedEmailAddress'), args)
|
||||
@ -14,8 +15,8 @@ export default {
|
||||
throw new UserInputError('must be a valid email')
|
||||
}
|
||||
|
||||
let response = await existingEmailAddress(_parent, args, context)
|
||||
if (response) return response
|
||||
// check email does not belong to anybody
|
||||
await existingEmailAddress(_parent, args, context)
|
||||
|
||||
const nonce = generateNonce()
|
||||
const {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user