-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade to .NET 8 and latest .NET 8 template
- Loading branch information
Showing
70 changed files
with
4,677 additions
and
758 deletions.
There are no files selected for viewing
6 changes: 3 additions & 3 deletions
6
TalentBlazor/Data/ApplicationDbContext.cs → ...iceInterface/Data/ApplicationDbContext.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
using Microsoft.AspNetCore.Identity.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore; | ||
using TalentBlazor.ServiceModel; | ||
|
||
namespace TalentBlazor.Data; | ||
|
||
public class ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : IdentityDbContext<ApplicationUser>(options) | ||
public class ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) | ||
: IdentityDbContext<ApplicationUser>(options) | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System.Security.Claims; | ||
using Microsoft.AspNetCore.Identity; | ||
using Microsoft.Extensions.Options; | ||
using ServiceStack; | ||
using ServiceStack.Web; | ||
|
||
namespace TalentBlazor.Data; | ||
|
||
public class CustomUserSession : AuthUserSession | ||
{ | ||
public override void PopulateFromClaims(IRequest httpReq, ClaimsPrincipal principal) | ||
{ | ||
// Populate Session with data from Identity Auth Claims | ||
ProfileUrl = principal.FindFirstValue(JwtClaimTypes.Picture); | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Add additional claims to the Identity Auth Cookie | ||
/// </summary> | ||
public class AdditionalUserClaimsPrincipalFactory( | ||
UserManager<ApplicationUser> userManager, | ||
RoleManager<IdentityRole> roleManager, | ||
IOptions<IdentityOptions> optionsAccessor) | ||
: UserClaimsPrincipalFactory<ApplicationUser,IdentityRole>(userManager, roleManager, optionsAccessor) | ||
{ | ||
public override async Task<ClaimsPrincipal> CreateAsync(ApplicationUser user) | ||
{ | ||
var principal = await base.CreateAsync(user); | ||
var identity = (ClaimsIdentity)principal.Identity!; | ||
|
||
var claims = new List<Claim>(); | ||
// Add additional claims here | ||
if (user.ProfileUrl != null) | ||
{ | ||
claims.Add(new Claim(JwtClaimTypes.Picture, user.ProfileUrl)); | ||
} | ||
|
||
identity.AddClaims(claims); | ||
return principal; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
@page "/Account/ForgotPassword" | ||
@page "/Account/ForgotPassword" | ||
|
||
@using System.ComponentModel.DataAnnotations | ||
@using System.Text | ||
|
@@ -16,23 +16,23 @@ | |
|
||
<PageTitle>Forgot your password?</PageTitle> | ||
|
||
<div class="max-w-xl"> | ||
<h1 class="mb-3 @Css.H1">Forgot your password?</h1> | ||
<h3 class="@Css.H3">Enter your email.</h3> | ||
<div class="mt-8 mx-auto max-w-lg"> | ||
<Heading1>Forgot your password?</Heading1> | ||
<Heading3>Enter your email.</Heading3> | ||
|
||
<EditForm Model="Input" FormName="forgot-password" OnValidSubmit="OnValidSubmitAsync" method="post"> | ||
<DataAnnotationsValidator /> | ||
<ValidationSummary class="@Css.ValidationSummary" /> | ||
<ValidationSummary class="mb-3 text-danger text-center font-semibold" /> | ||
<div class="flex flex-col gap-y-4"> | ||
<div> | ||
<label for="email" class="@Css.InputLabel">Email</label> | ||
<label for="email" class="@TextInput.LabelClasses">Email</label> | ||
<div class="mt-1 relative rounded-md shadow-sm"> | ||
<InputText id="email" type="text" @bind-Value="Input.Email" class="@Css.InputText" autocomplete="username" aria-required="true" placeholder="[email protected]" /> | ||
<InputText id="email" type="text" @bind-Value="Input.Email" class="@TextInput.InputClasses" autocomplete="username" aria-required="true" placeholder="[email protected]" /> | ||
</div> | ||
<ValidationMessage For="() => Input.Email" class="@Css.ValidationMessage" /> | ||
<ValidationMessage For="() => Input.Email" class="mt-2 text-danger text-sm" /> | ||
</div> | ||
<div> | ||
<button type="submit" class="@Css.PrimaryButton">Reset password</button> | ||
<PrimaryButton type="submit">Reset password</PrimaryButton> | ||
</div> | ||
</div> | ||
</EditForm> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.