mirror of
https://github.com/bitwarden/server.git
synced 2025-07-02 00:22:50 -05:00
[PM-1033] feat: remove user verification from password enrollment
This commit is contained in:
@ -313,17 +313,9 @@ public class OrganizationUsersController : Controller
|
|||||||
throw new UnauthorizedAccessException();
|
throw new UnauthorizedAccessException();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (model.ResetPasswordKey != null && !await _userService.VerifySecretAsync(user, model.Secret))
|
var callingUserId = user.Id;
|
||||||
{
|
await _organizationService.UpdateUserResetPasswordEnrollmentAsync(
|
||||||
await Task.Delay(2000);
|
new Guid(orgId), new Guid(userId), model.ResetPasswordKey, callingUserId);
|
||||||
throw new BadRequestException("MasterPasswordHash", "Invalid password.");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var callingUserId = user.Id;
|
|
||||||
await _organizationService.UpdateUserResetPasswordEnrollmentAsync(
|
|
||||||
new Guid(orgId), new Guid(userId), model.ResetPasswordKey, callingUserId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPut("{id}/reset-password")]
|
[HttpPut("{id}/reset-password")]
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using Bit.Api.Auth.Models.Request.Accounts;
|
|
||||||
using Bit.Core.Entities;
|
using Bit.Core.Entities;
|
||||||
using Bit.Core.Enums;
|
using Bit.Core.Enums;
|
||||||
using Bit.Core.Models.Data;
|
using Bit.Core.Models.Data;
|
||||||
@ -108,7 +107,7 @@ public class OrganizationUserUpdateGroupsRequestModel
|
|||||||
public IEnumerable<string> GroupIds { get; set; }
|
public IEnumerable<string> GroupIds { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class OrganizationUserResetPasswordEnrollmentRequestModel : SecretVerificationRequestModel
|
public class OrganizationUserResetPasswordEnrollmentRequestModel
|
||||||
{
|
{
|
||||||
public string ResetPasswordKey { get; set; }
|
public string ResetPasswordKey { get; set; }
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user