mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-02-21 22:24:23 +01:00
This commit is contained in:
@@ -655,15 +655,8 @@ namespace BTCPayServer.Tests
|
||||
tester.PayTester.DisableRegistration = true;
|
||||
await tester.StartAsync();
|
||||
var unauthClient = new BTCPayServerClient(tester.PayTester.ServerUri);
|
||||
await AssertValidationError(new[] { "Email", "Password" },
|
||||
await AssertValidationError(new[] { "Email" },
|
||||
async () => await unauthClient.CreateUser(new CreateApplicationUserRequest()));
|
||||
await AssertValidationError(new[] { "Password" },
|
||||
async () => await unauthClient.CreateUser(
|
||||
new CreateApplicationUserRequest() { Email = "test@gmail.com" }));
|
||||
// Pass too simple
|
||||
await AssertValidationError(new[] { "Password" },
|
||||
async () => await unauthClient.CreateUser(
|
||||
new CreateApplicationUserRequest() { Email = "test3@gmail.com", Password = "a" }));
|
||||
|
||||
// We have no admin, so it should work
|
||||
var user1 = await unauthClient.CreateUser(
|
||||
@@ -1347,10 +1340,6 @@ namespace BTCPayServer.Tests
|
||||
Password = Guid.NewGuid().ToString()
|
||||
}));
|
||||
|
||||
await AssertValidationError(new[] { "Password" }, async () =>
|
||||
await clientServer.CreateUser(
|
||||
new CreateApplicationUserRequest() { Email = $"{Guid.NewGuid()}@g.com", }));
|
||||
|
||||
await AssertValidationError(new[] { "Email" }, async () =>
|
||||
await clientServer.CreateUser(
|
||||
new CreateApplicationUserRequest() { Password = Guid.NewGuid().ToString() }));
|
||||
|
||||
@@ -124,8 +124,6 @@ namespace BTCPayServer.Controllers.Greenfield
|
||||
{
|
||||
ModelState.AddModelError(nameof(request.Email), "Invalid email");
|
||||
}
|
||||
if (request.Password is null)
|
||||
ModelState.AddModelError(nameof(request.Password), "Password is missing");
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
return this.CreateValidationError(ModelState);
|
||||
|
||||
@@ -108,7 +108,8 @@
|
||||
},
|
||||
"password": {
|
||||
"type": "string",
|
||||
"description": "The password of the new user"
|
||||
"description": "The password of the new user (if no password is set, an email will be sent to the user requiring him to set the password)",
|
||||
"nullable": true
|
||||
},
|
||||
"isAdministrator": {
|
||||
"type": "boolean",
|
||||
|
||||
Reference in New Issue
Block a user