-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User identity #2
Changes from all commits
1aab947
133d305
cd51401
e1be7fe
6713a03
0fd86ec
adf5456
59d7201
9fa690d
8f5431a
fa9665a
51edeea
4f66712
2058b1d
e1a8615
da88176
1ec66a9
59625c6
9214e00
dae68f2
75b17f6
4f9ea15
f301692
be37813
1dc34ea
5345d98
86dc39a
c97574d
48035d9
59f5488
f484393
c0f880c
93e5cf4
6901470
00e7fb7
9163564
fe53a51
c7afcf3
9d86826
a175ddf
877b3d1
84a6630
fa2abbb
2fc6386
b732883
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Tests | ||
on: [ workflow_call ] | ||
jobs: | ||
qa: | ||
runs-on: ARM64 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
submodules: 'recursive' | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: 8.0.x | ||
- name: Install .NET Aspire workload | ||
run: dotnet workload install aspire | ||
- name: Install dependencies | ||
run: dotnet restore | ||
- name: Build | ||
run: dotnet build --no-restore --verbosity normal | ||
- name: Test | ||
run: dotnet test --no-build --verbosity normal |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "Contracts"] | ||
path = Contracts | ||
url = [email protected]:argon-chat/Contracts.git |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="8.0.10"/> | ||
</ItemGroup> | ||
|
||
</Project> |
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,7 @@ | ||||||||||
using Microsoft.AspNetCore.Identity; | ||||||||||
|
||||||||||
namespace Argon.Api.Common.Models; | ||||||||||
|
||||||||||
public class ApplicationUser : IdentityUser<Guid> | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AspNetCore.Identity не научился в рекорды? |
||||||||||
{ | ||||||||||
} | ||||||||||
Comment on lines
+5
to
+7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using Argon.Api.Common.Models; | ||
using Microsoft.AspNetCore.Identity; | ||
using Microsoft.Extensions.Logging; | ||
|
||
namespace Argon.Api.Common.Services; | ||
|
||
public class EmailSender(ILogger<EmailSender> logger) : IEmailSender<ApplicationUser> | ||
{ | ||
public Task SendConfirmationLinkAsync(ApplicationUser user, string email, string confirmationLink) | ||
{ | ||
logger.LogInformation( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. реализация |
||
"Sending confirmation link to {email} for user {user} with confirmation link {confirmationLink}", email, | ||
user.UserName, confirmationLink); | ||
return Task.CompletedTask; | ||
} | ||
|
||
public Task SendPasswordResetLinkAsync(ApplicationUser user, string email, string resetLink) | ||
{ | ||
logger.LogInformation("Sending password reset link to {email} for user {user} with reset link {resetLink}", | ||
email, user.UserName, resetLink); | ||
return Task.CompletedTask; | ||
} | ||
|
||
public Task SendPasswordResetCodeAsync(ApplicationUser user, string email, string resetCode) | ||
{ | ||
logger.LogInformation("Sending password reset code to {email} for user {user} with reset code {resetCode}", | ||
email, user.UserName, resetCode); | ||
return Task.CompletedTask; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
using Argon.Api.Common.Models; | ||
using Microsoft.AspNetCore.Identity; | ||
using Microsoft.AspNetCore.Identity.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore; | ||
|
||
namespace Argon.Api.Entities; | ||
|
||
public class ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : DbContext(options); | ||
public class ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) | ||
: IdentityDbContext<ApplicationUser, IdentityRole<Guid>, Guid>(options); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.