mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
fix(backend): fix registration with invite code (#8513)
* fix registration with invite code * save one db call * fix
This commit is contained in:
parent
ac79452ce6
commit
2278a9e311
@ -88,15 +88,18 @@ export default {
|
|||||||
const [user] = createUserTransactionResponse.records.map((record) => record.get('user'))
|
const [user] = createUserTransactionResponse.records.map((record) => record.get('user'))
|
||||||
if (!user) throw new UserInputError('Invalid email or nonce')
|
if (!user) throw new UserInputError('Invalid email or nonce')
|
||||||
|
|
||||||
// To allow redeeming and return an User object we require a User in the context
|
|
||||||
context.user = user
|
|
||||||
// join Group via invite Code
|
|
||||||
await redeemInviteCode(context, inviteCode, true)
|
|
||||||
|
|
||||||
return user
|
return user
|
||||||
})
|
})
|
||||||
try {
|
try {
|
||||||
const user = await writeTxResultPromise
|
const user = await writeTxResultPromise
|
||||||
|
|
||||||
|
// To allow redeeming and return an User object we require a User in the context
|
||||||
|
context.user = user
|
||||||
|
|
||||||
|
if (inviteCode) {
|
||||||
|
await redeemInviteCode(context, inviteCode, true)
|
||||||
|
}
|
||||||
|
|
||||||
return user
|
return user
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e.code === 'Neo.ClientError.Schema.ConstraintValidationFailed')
|
if (e.code === 'Neo.ClientError.Schema.ConstraintValidationFailed')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user