mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 21:23:45 +01:00
Admin tools, Authentication: Fix: set analyticsId when creating a new user
This commit is contained in:
committed by
yu-i-i
parent
1e0e9473d2
commit
f13a251381
@@ -116,6 +116,7 @@ async function registerNewUser(req, res, next) {
|
||||
}
|
||||
delete req.body.isExternal
|
||||
req.body.password = crypto.randomBytes(32).toString('hex')
|
||||
req.body.analyticsId = crypto.randomUUID()
|
||||
|
||||
let user
|
||||
try {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import crypto from 'node:crypto'
|
||||
import Settings from '@overleaf/settings'
|
||||
import UserCreator from '../../../../../app/src/Features/User/UserCreator.mjs'
|
||||
import { ParallelLoginError } from '../../../../../app/src/Features/Authentication/AuthenticationErrors.mjs'
|
||||
@@ -42,6 +43,7 @@ const LDAPAuthenticationManager = {
|
||||
last_name: lastName,
|
||||
isAdmin: isAdmin,
|
||||
holdingAccount: false,
|
||||
analyticsId: crypto.randomUUID(),
|
||||
}
|
||||
)
|
||||
await User.updateOne(
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import crypto from 'node:crypto'
|
||||
import Settings from '@overleaf/settings'
|
||||
import UserCreator from '../../../../../app/src/Features/User/UserCreator.mjs'
|
||||
import ThirdPartyIdentityManager from '../../../../../app/src/Features/User/ThirdPartyIdentityManager.mjs'
|
||||
@@ -58,6 +59,7 @@ const OIDCAuthenticationManager = {
|
||||
last_name: lastName,
|
||||
isAdmin: isAdmin,
|
||||
holdingAccount: false,
|
||||
analyticsId: crypto.randomUUID(),
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import crypto from 'node:crypto'
|
||||
import Settings from '@overleaf/settings'
|
||||
import UserCreator from '../../../../../app/src/Features/User/UserCreator.mjs'
|
||||
import { ParallelLoginError } from '../../../../../app/src/Features/Authentication/AuthenticationErrors.mjs'
|
||||
@@ -43,6 +44,7 @@ const SAMLAuthenticationManager = {
|
||||
isAdmin: isAdmin,
|
||||
holdingAccount: false,
|
||||
samlIdentifiers: [{ providerId: providerId }],
|
||||
analyticsId: crypto.randomUUID(),
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user