mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 13:13:45 +01:00
Fix: set analyticsId when registering via the Sign Up page (#256)
registerNewUser() requires analyticsId (UserCreator throws 'bug: attributes.analyticsId is missing'), so every sign-up through the registration-page module failed with a 500. Same fix as #208 for admin-tools. Fixes #255
This commit is contained in:
@@ -12,7 +12,7 @@ export default async function registerNewUserAndSendActivationEmail(userData) {
|
|||||||
let user
|
let user
|
||||||
try {
|
try {
|
||||||
const password = crypto.randomBytes(32).toString('hex')
|
const password = crypto.randomBytes(32).toString('hex')
|
||||||
user = await UserRegistrationHandler.promises.registerNewUser({ ...userData, password })
|
user = await UserRegistrationHandler.promises.registerNewUser({ ...userData, password, analyticsId: crypto.randomUUID() })
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.message === 'EmailAlreadyRegistered') {
|
if (error.message === 'EmailAlreadyRegistered') {
|
||||||
logger.debug({ email: userData.email }, 'user already registered')
|
logger.debug({ email: userData.email }, 'user already registered')
|
||||||
|
|||||||
Reference in New Issue
Block a user