mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
fix: ensure no other user owns a new email address
`BELONGS_TO` means a user owns an email address. `PRIMARY_EMAIL` means a user authenticates with that email. So right now, you get a proper error message if you try to change your email back to your old email address (because you own it already). I will make sure to delete the old email so this will be no problem anymore. But maybe in the future we might have multiple email addresses per user and then it makes a big difference to use `PRIMARY_EMAIL` or `BELONGS_TO`.
This commit is contained in:
parent
6a7970200f
commit
6ffafff288
@ -4,7 +4,7 @@ export default async function alreadyExistingMail(_parent, args, context) {
|
||||
email = email.toLowerCase()
|
||||
const cypher = `
|
||||
MATCH (email:EmailAddress {email: $email})
|
||||
OPTIONAL MATCH (email)-[:PRIMARY_EMAIL]-(user)
|
||||
OPTIONAL MATCH (email)-[:BELONGS_TO]-(user)
|
||||
RETURN email, user
|
||||
`
|
||||
let transactionRes
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user