fix cypher to have signup verification to block posts of groups for new users

This commit is contained in:
Moriz Wahl 2022-10-04 05:44:11 +02:00
parent 275d196cb6
commit 03434071b4
2 changed files with 15 additions and 7 deletions

View File

@ -19,6 +19,7 @@ export const signupVerificationMutation = gql`
nonce: $nonce
termsAndConditionsAgreedVersion: $termsAndConditionsAgreedVersion
) {
id
slug
}
}

View File

@ -95,6 +95,13 @@ const signupCypher = (inviteCode) => {
SET user.showShoutsPublicly = false
SET user.sendNotificationEmails = true
SET email.verifiedAt = toString(datetime())
WITH user
OPTIONAL MATCH (post:Post)-[:IN]->(group:Group)
WHERE NOT group.groupType = 'public'
WITH user, collect(post) AS invisiblePosts
FOREACH (invisiblePost IN invisiblePosts |
MERGE (user)-[:CANNOT_SEE]->(invisiblePost)
)
RETURN user {.*}
`
return cypher