mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 13:13: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
f71de2eacc
commit
24e2fdaab5
@@ -116,6 +116,7 @@ async function registerNewUser(req, res, next) {
|
|||||||
}
|
}
|
||||||
delete req.body.isExternal
|
delete req.body.isExternal
|
||||||
req.body.password = crypto.randomBytes(32).toString('hex')
|
req.body.password = crypto.randomBytes(32).toString('hex')
|
||||||
|
req.body.analyticsId = crypto.randomUUID()
|
||||||
|
|
||||||
let user
|
let user
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import crypto from 'node:crypto'
|
||||||
import Settings from '@overleaf/settings'
|
import Settings from '@overleaf/settings'
|
||||||
import UserCreator from '../../../../../app/src/Features/User/UserCreator.mjs'
|
import UserCreator from '../../../../../app/src/Features/User/UserCreator.mjs'
|
||||||
import { ParallelLoginError } from '../../../../../app/src/Features/Authentication/AuthenticationErrors.mjs'
|
import { ParallelLoginError } from '../../../../../app/src/Features/Authentication/AuthenticationErrors.mjs'
|
||||||
@@ -42,6 +43,7 @@ const LDAPAuthenticationManager = {
|
|||||||
last_name: lastName,
|
last_name: lastName,
|
||||||
isAdmin: isAdmin,
|
isAdmin: isAdmin,
|
||||||
holdingAccount: false,
|
holdingAccount: false,
|
||||||
|
analyticsId: crypto.randomUUID(),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
await User.updateOne(
|
await User.updateOne(
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import crypto from 'node:crypto'
|
||||||
import Settings from '@overleaf/settings'
|
import Settings from '@overleaf/settings'
|
||||||
import UserCreator from '../../../../../app/src/Features/User/UserCreator.mjs'
|
import UserCreator from '../../../../../app/src/Features/User/UserCreator.mjs'
|
||||||
import ThirdPartyIdentityManager from '../../../../../app/src/Features/User/ThirdPartyIdentityManager.mjs'
|
import ThirdPartyIdentityManager from '../../../../../app/src/Features/User/ThirdPartyIdentityManager.mjs'
|
||||||
@@ -58,6 +59,7 @@ const OIDCAuthenticationManager = {
|
|||||||
last_name: lastName,
|
last_name: lastName,
|
||||||
isAdmin: isAdmin,
|
isAdmin: isAdmin,
|
||||||
holdingAccount: false,
|
holdingAccount: false,
|
||||||
|
analyticsId: crypto.randomUUID(),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import crypto from 'node:crypto'
|
||||||
import Settings from '@overleaf/settings'
|
import Settings from '@overleaf/settings'
|
||||||
import UserCreator from '../../../../../app/src/Features/User/UserCreator.mjs'
|
import UserCreator from '../../../../../app/src/Features/User/UserCreator.mjs'
|
||||||
import { ParallelLoginError } from '../../../../../app/src/Features/Authentication/AuthenticationErrors.mjs'
|
import { ParallelLoginError } from '../../../../../app/src/Features/Authentication/AuthenticationErrors.mjs'
|
||||||
@@ -43,6 +44,7 @@ const SAMLAuthenticationManager = {
|
|||||||
isAdmin: isAdmin,
|
isAdmin: isAdmin,
|
||||||
holdingAccount: false,
|
holdingAccount: false,
|
||||||
samlIdentifiers: [{ providerId: providerId }],
|
samlIdentifiers: [{ providerId: providerId }],
|
||||||
|
analyticsId: crypto.randomUUID(),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user