mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 14:43:46 +01:00
[web] Clear hardcoded password in external SP auth (#33597)
registerExternalAuthAdmin() now generates a random password on admin registration. A migration clears the password for existing installs only in CE/SP GitOrigin-RevId: 94a82d35dc8cd46915c31fb24f477c19367025eb
This commit is contained in:
@@ -759,14 +759,16 @@ describe('LaunchpadController', function () {
|
||||
ctx.UserRegistrationHandler.promises.registerNewUser.callCount.should.equal(
|
||||
1
|
||||
)
|
||||
ctx.UserRegistrationHandler.promises.registerNewUser
|
||||
.calledWith({
|
||||
email: ctx.email,
|
||||
password: 'password_here',
|
||||
first_name: ctx.email,
|
||||
last_name: '',
|
||||
})
|
||||
.should.equal(true)
|
||||
const call =
|
||||
ctx.UserRegistrationHandler.promises.registerNewUser.firstCall
|
||||
expect(call.args[0]).to.include({
|
||||
email: ctx.email,
|
||||
first_name: ctx.email,
|
||||
last_name: '',
|
||||
})
|
||||
expect(call.args[0].password).to.be.a('string')
|
||||
expect(call.args[0].password).to.not.equal('password_here')
|
||||
expect(call.args[0].password.length).to.be.at.least(16)
|
||||
})
|
||||
|
||||
it('should have updated the user to make them an admin', function (ctx) {
|
||||
@@ -964,14 +966,16 @@ describe('LaunchpadController', function () {
|
||||
ctx.UserRegistrationHandler.promises.registerNewUser.callCount.should.equal(
|
||||
1
|
||||
)
|
||||
ctx.UserRegistrationHandler.promises.registerNewUser
|
||||
.calledWith({
|
||||
email: ctx.email,
|
||||
password: 'password_here',
|
||||
first_name: ctx.email,
|
||||
last_name: '',
|
||||
})
|
||||
.should.equal(true)
|
||||
const call =
|
||||
ctx.UserRegistrationHandler.promises.registerNewUser.firstCall
|
||||
expect(call.args[0]).to.include({
|
||||
email: ctx.email,
|
||||
first_name: ctx.email,
|
||||
last_name: '',
|
||||
})
|
||||
expect(call.args[0].password).to.be.a('string')
|
||||
expect(call.args[0].password).to.not.equal('password_here')
|
||||
expect(call.args[0].password.length).to.be.at.least(16)
|
||||
})
|
||||
|
||||
it('should not call update', function (ctx) {
|
||||
@@ -1015,14 +1019,16 @@ describe('LaunchpadController', function () {
|
||||
ctx.UserRegistrationHandler.promises.registerNewUser.callCount.should.equal(
|
||||
1
|
||||
)
|
||||
ctx.UserRegistrationHandler.promises.registerNewUser
|
||||
.calledWith({
|
||||
email: ctx.email,
|
||||
password: 'password_here',
|
||||
first_name: ctx.email,
|
||||
last_name: '',
|
||||
})
|
||||
.should.equal(true)
|
||||
const call =
|
||||
ctx.UserRegistrationHandler.promises.registerNewUser.firstCall
|
||||
expect(call.args[0]).to.include({
|
||||
email: ctx.email,
|
||||
first_name: ctx.email,
|
||||
last_name: '',
|
||||
})
|
||||
expect(call.args[0].password).to.be.a('string')
|
||||
expect(call.args[0].password).to.not.equal('password_here')
|
||||
expect(call.args[0].password.length).to.be.at.least(16)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user