mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Don't remove dots in emails
This commit is contained in:
parent
4861ab26dd
commit
9e2baf25d2
@ -3,7 +3,7 @@ import Resolver from './helpers/Resolver'
|
|||||||
import existingEmailAddress from './helpers/existingEmailAddress'
|
import existingEmailAddress from './helpers/existingEmailAddress'
|
||||||
import { UserInputError } from 'apollo-server'
|
import { UserInputError } from 'apollo-server'
|
||||||
import Validator from 'neode/build/Services/Validator.js'
|
import Validator from 'neode/build/Services/Validator.js'
|
||||||
import { normalizeEmail } from 'validator'
|
import normalizeEmail from './helpers/normalizeEmail'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
Mutation: {
|
Mutation: {
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { normalizeEmail } from 'validator'
|
import normalizeEmail from './normalizeEmail'
|
||||||
|
|
||||||
export default async function createPasswordReset(options) {
|
export default async function createPasswordReset(options) {
|
||||||
const { driver, nonce, email, issuedAt = new Date() } = options
|
const { driver, nonce, email, issuedAt = new Date() } = options
|
||||||
|
|||||||
10
backend/src/schema/resolvers/helpers/normalizeEmail.js
Normal file
10
backend/src/schema/resolvers/helpers/normalizeEmail.js
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import { normalizeEmail } from 'validator'
|
||||||
|
|
||||||
|
export default (email) => normalizeEmail(email, {
|
||||||
|
gmail_remove_dots: false,
|
||||||
|
gmail_remove_subaddress: false,
|
||||||
|
// gmail_convert_googlemaildotcom: true, default
|
||||||
|
outlookdotcom_remove_subaddress: false,
|
||||||
|
yahoo_remove_subaddress: false,
|
||||||
|
icloud_remove_subaddress: false,
|
||||||
|
})
|
||||||
@ -4,7 +4,7 @@ import fileUpload from './fileUpload'
|
|||||||
import encryptPassword from '../../helpers/encryptPassword'
|
import encryptPassword from '../../helpers/encryptPassword'
|
||||||
import generateNonce from './helpers/generateNonce'
|
import generateNonce from './helpers/generateNonce'
|
||||||
import existingEmailAddress from './helpers/existingEmailAddress'
|
import existingEmailAddress from './helpers/existingEmailAddress'
|
||||||
import { normalizeEmail } from 'validator'
|
import normalizeEmail from './helpers/normalizeEmail'
|
||||||
|
|
||||||
const instance = neode()
|
const instance = neode()
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import encode from '../../jwt/encode'
|
|||||||
import bcrypt from 'bcryptjs'
|
import bcrypt from 'bcryptjs'
|
||||||
import { AuthenticationError } from 'apollo-server'
|
import { AuthenticationError } from 'apollo-server'
|
||||||
import { neode } from '../../bootstrap/neo4j'
|
import { neode } from '../../bootstrap/neo4j'
|
||||||
import { normalizeEmail } from 'validator'
|
import normalizeEmail from './helpers/normalizeEmail'
|
||||||
|
|
||||||
const instance = neode()
|
const instance = neode()
|
||||||
|
|
||||||
|
|||||||
@ -46,7 +46,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import { SweetalertIcon } from 'vue-sweetalert-icons'
|
import { SweetalertIcon } from 'vue-sweetalert-icons'
|
||||||
import { normalizeEmail } from 'validator'
|
import normalizeEmail from '~/components/utils/NormalizeEmail'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
|||||||
10
webapp/components/utils/NormalizeEmail.js
Normal file
10
webapp/components/utils/NormalizeEmail.js
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import { normalizeEmail } from 'validator'
|
||||||
|
|
||||||
|
export default (email) => normalizeEmail(email, {
|
||||||
|
gmail_remove_dots: false,
|
||||||
|
gmail_remove_subaddress: false,
|
||||||
|
// gmail_convert_googlemaildotcom: true, default
|
||||||
|
outlookdotcom_remove_subaddress: false,
|
||||||
|
yahoo_remove_subaddress: false,
|
||||||
|
icloud_remove_subaddress: false,
|
||||||
|
})
|
||||||
@ -67,7 +67,8 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import { isEmail, normalizeEmail } from 'validator'
|
import { isEmail } from 'validator'
|
||||||
|
import normalizeEmail from '~/components/utils/NormalizeEmail'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
|
|||||||
@ -32,7 +32,7 @@
|
|||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
import { AddEmailAddressMutation } from '~/graphql/EmailAddress.js'
|
import { AddEmailAddressMutation } from '~/graphql/EmailAddress.js'
|
||||||
import { SweetalertIcon } from 'vue-sweetalert-icons'
|
import { SweetalertIcon } from 'vue-sweetalert-icons'
|
||||||
import { normalizeEmail } from 'validator'
|
import normalizeEmail from '~/components/utils/NormalizeEmail'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user