mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 21:23:45 +01:00
[web] throw early in UserCreator.createNewUser with missing analyticsId (#34664)
* [web] throw early in UserCreator.createNewUser with missing analyticsId * [migrations] rerun back-fill of db.users.analyticsId GitOrigin-RevId: eabf16326192fca4dbea00ad643cee4315c426c6
This commit is contained in:
@@ -14,6 +14,7 @@ import OError from '@overleaf/o-error'
|
||||
import fs from 'node:fs'
|
||||
import Path from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import crypto from 'node:crypto'
|
||||
|
||||
const MONOREPO = Path.dirname(
|
||||
Path.dirname(Path.dirname(Path.dirname(fileURLToPath(import.meta.url))))
|
||||
@@ -42,6 +43,7 @@ async function createUser(
|
||||
const user = await UserRegistrationHandler.promises.registerNewUser({
|
||||
email,
|
||||
password: PASSWORD,
|
||||
analyticsId: crypto.randomUUID(),
|
||||
})
|
||||
userId = user._id
|
||||
} catch (err) {
|
||||
|
||||
@@ -11,6 +11,7 @@ import UserDeleter from '../app/src/Features/User/UserDeleter.mjs'
|
||||
import UserRegistrationHandler from '../app/src/Features/User/UserRegistrationHandler.mjs'
|
||||
import HistoryManager from '../app/src/Features/History/HistoryManager.mjs'
|
||||
import ProjectCreationHandler from '../app/src/Features/Project/ProjectCreationHandler.mjs'
|
||||
import crypto from 'node:crypto'
|
||||
|
||||
const MONOREPO = Path.dirname(
|
||||
Path.dirname(Path.dirname(Path.dirname(fileURLToPath(import.meta.url))))
|
||||
@@ -24,6 +25,7 @@ async function createUser(email) {
|
||||
const user = await UserRegistrationHandler.promises.registerNewUser({
|
||||
email,
|
||||
password: process.env.CYPRESS_DEFAULT_PASSWORD,
|
||||
analyticsId: crypto.randomUUID(),
|
||||
})
|
||||
const features = email.startsWith('free+')
|
||||
? Settings.defaultFeatures
|
||||
|
||||
Reference in New Issue
Block a user