Skip to content
This repository was archived by the owner on Aug 1, 2021. It is now read-only.

Commit 0755698

Browse files
committed
bug fix
1 parent 708ba12 commit 0755698

File tree

9 files changed

+34
-53
lines changed

9 files changed

+34
-53
lines changed

build/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ services:
3838
ApplicationSettings:UserManagementURL: http://localhost:4200
3939
ApplicationSettings:IS4AdminUi: http://localhost:4300
4040
ApplicationSettings:ResourceServerURL: http://localhost:5003
41+
CertificateOptions:Type: Temporary
4142

4243
# #############################
4344
# # Management API

build/jpproject-docker-windows.zip

20 Bytes
Binary file not shown.

src/Backend/Jp.UserManagement/appsettings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"SendEmail": "false"
3232
},
3333
"ApplicationSettings": {
34-
"DatabaseType": "MySql"
34+
"DatabaseType": "MySql",
35+
"Authority": "https://localhost:5001"
3536
}
3637
}

src/Backend/Jp.UserManagement/tempkey.rsa

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/Frontend/Jp.UI.SSO/appsettings.Development.json

Lines changed: 0 additions & 49 deletions
This file was deleted.

src/Frontend/Jp.UI.SSO/appsettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
}
4343
},
4444
"ApplicationSettings": {
45-
"EnableExternalProviders": true,
45+
"EnableExternalProviders": "true",
4646
"UserManagementURL": "http://localhost:4200",
4747
"IS4AdminUi": "http://localhost:4300",
4848
"DatabaseType": "MySql",

src/Frontend/Jp.UI.SSO/tempkey.rsa

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/JpProject.Domain.Tests/UserTests/Fakers/UserCommandFaker.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@ public static Faker<AddLoginCommand> GenerateAddLoginCommand()
4545
);
4646
}
4747

48+
public static Faker<SendResetLinkCommand> GenerateSendResetLinkCommand(string username = null, string email = null)
49+
{
50+
return new Faker<SendResetLinkCommand>().CustomInstantiator(
51+
f => new SendResetLinkCommand(
52+
email ?? f.Person.Email,
53+
f.Person.UserName
54+
)
55+
);
56+
}
4857

4958
}
5059
}

tests/JpProject.Domain.Tests/UserTests/UserCommandHandlerTests.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,27 @@ public async Task ShouldNotAddNewUserIfPasswordDifferFromConfirmation()
120120
var result = await _commandHandler.Handle(command, _tokenSource.Token);
121121

122122

123+
Assert.False(result);
124+
}
125+
126+
[Fact]
127+
public async Task ShouldNotGenerateResetLinkIfNotProvideUsername()
128+
{
129+
var command = UserCommandFaker.GenerateSendResetLinkCommand(email: string.Empty).Generate();
130+
131+
var result = await _commandHandler.Handle(command, _tokenSource.Token);
132+
133+
134+
Assert.False(result);
135+
}
136+
[Fact]
137+
public async Task ShouldNotGenerateResetLinkIfNotProvideEmail()
138+
{
139+
var command = UserCommandFaker.GenerateSendResetLinkCommand(email: string.Empty).Generate();
140+
141+
var result = await _commandHandler.Handle(command, _tokenSource.Token);
142+
143+
123144
Assert.False(result);
124145
}
125146
}

0 commit comments

Comments
 (0)