Skip to content

dougbu/head-3 #18371

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

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions eng/PoliCheckExclusions.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<PoliCheckExclusions>
<Exclusion Type="FolderPathFull">LINUX_TEST_RESULTS|MACOS_TEST_RESULTS|WINDOWS_TEST_RESULTS|LINUX_TEST_LOGS|MACOS_TEST_LOGS|WINDOWS_TEST_LOGS|WINDOWS_TEST_TEMPLATES_LOGS</Exclusion>
</PoliCheckExclusions>
<Exclusion Type="FolderPathFull">LINUX_TEST_RESULTS|MACOS_TEST_RESULTS|WINDOWS_TEST_RESULTS</Exclusion>
</PoliCheckExclusions>
2 changes: 1 addition & 1 deletion eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
-->
<Dependencies>
<ProductDependencies>
<Dependency Name="Microsoft.AspNetCore.Blazor.Mono" Version="3.1.0-preview4.19605.1" Pinned="true">
<Dependency Name="Microsoft.AspNetCore.Blazor.Mono" Version="3.1.0-preview4.19605.1">
<Uri>https://github.com/aspnet/Blazor</Uri>
<Sha>7868699de745fd30a654c798a99dc541b77b95c0</Sha>
</Dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Description>Build client-side single-page applications (SPAs) with Blazor running under WebAssembly.</Description>
<IsShippingPackage>false</IsShippingPackage>
<IsShippingPackage>true</IsShippingPackage>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
<Description>Build mechanism for ASP.NET Core Blazor applications.</Description>
<OutputType>Exe</OutputType>
<IsShippingPackage>false</IsShippingPackage>
<IsShippingPackage>true</IsShippingPackage>
<HasReferenceAssembly>false</HasReferenceAssembly>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<OutputType>Exe</OutputType>
<AssemblyName>blazor-devserver</AssemblyName>
<PackageId>Microsoft.AspNetCore.Blazor.DevServer</PackageId>
<IsShippingPackage>false</IsShippingPackage>
<IsShippingPackage>true</IsShippingPackage>
<HasReferenceAssembly>false</HasReferenceAssembly>
<StartupObject>Microsoft.AspNetCore.Blazor.DevServer.Program</StartupObject>
<Description>Development server for use when building Blazor applications.</Description>
Expand Down
2 changes: 2 additions & 0 deletions src/Components/Blazor/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<PropertyGroup>
<!-- Override prerelease label and use preview 4, even in the final build -->
<PreReleaseVersionLabel>$(BlazorClientPreReleaseVersionLabel)</PreReleaseVersionLabel>
<!-- These packages ship from the blazor-wasm branch -->
<IsShipping>false</IsShipping>
<DotNetFinalVersionKind></DotNetFinalVersionKind>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Description>Provides experimental support for using System.Text.Json with HttpClient. Intended for use with Blazor running under WebAssembly.</Description>
<IsShippingPackage>false</IsShippingPackage>
<IsShippingPackage>true</IsShippingPackage>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
<Description>Runtime server features for ASP.NET Core Blazor applications.</Description>
<IsShippingPackage>false</IsShippingPackage>
<IsShippingPackage>true</IsShippingPackage>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<NuspecFile>Microsoft.AspNetCore.Blazor.Templates.nuspec</NuspecFile>
<IsShippingPackage>false</IsShippingPackage>
<IsShippingPackage>true</IsShippingPackage>
<EnableDefaultItems>False</EnableDefaultItems>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<IncludeBuildOutput>False</IncludeBuildOutput>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Description>Provides experimental support for validation using DataAnnotations.</Description>
<IsShippingPackage>false</IsShippingPackage>
<IsShippingPackage>true</IsShippingPackage>
<HasReferenceAssembly>false</HasReferenceAssembly>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,13 @@ public override async Task<IActionResult> OnPostConfirmationAsync(string returnU
{
_logger.LogInformation("User created an account using {Name} provider.", info.LoginProvider);

// If account confirmation is required, we need to show the link if we don't have a real email sender
if (_userManager.Options.SignIn.RequireConfirmedAccount)
{
return RedirectToPage("./RegisterConfirmation", new { Email = Input.Email });
}

await _signInManager.SignInAsync(user, isPersistent: false);
var userId = await _userManager.GetUserIdAsync(user);
var code = await _userManager.GenerateEmailConfirmationTokenAsync(user);
code = WebEncoders.Base64UrlEncode(Encoding.UTF8.GetBytes(code));
Expand All @@ -208,14 +215,6 @@ public override async Task<IActionResult> OnPostConfirmationAsync(string returnU

await _emailSender.SendEmailAsync(Input.Email, "Confirm your email",
$"Please confirm your account by <a href='{HtmlEncoder.Default.Encode(callbackUrl)}'>clicking here</a>.");

// If account confirmation is required, we need to show the link if we don't have a real email sender
if (_userManager.Options.SignIn.RequireConfirmedAccount)
{
return RedirectToPage("./RegisterConfirmation", new { Email = Input.Email });
}

await _signInManager.SignInAsync(user, isPersistent: false);

return LocalRedirect(returnUrl);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@ public ExternalLoginModel(
_emailSender = emailSender;
}

public override IActionResult OnGet() => RedirectToPage("./Login");
public override IActionResult OnGet()
{
return RedirectToPage("./Login");
}

public override IActionResult OnPost(string provider, string returnUrl = null)
{
Expand Down Expand Up @@ -194,6 +197,13 @@ public override async Task<IActionResult> OnPostConfirmationAsync(string returnU
{
_logger.LogInformation("User created an account using {Name} provider.", info.LoginProvider);

// If account confirmation is required, we need to show the link if we don't have a real email sender
if (_userManager.Options.SignIn.RequireConfirmedAccount)
{
return RedirectToPage("./RegisterConfirmation", new { Email = Input.Email });
}

await _signInManager.SignInAsync(user, isPersistent: false);
var userId = await _userManager.GetUserIdAsync(user);
var code = await _userManager.GenerateEmailConfirmationTokenAsync(user);
code = WebEncoders.Base64UrlEncode(Encoding.UTF8.GetBytes(code));
Expand All @@ -206,13 +216,6 @@ public override async Task<IActionResult> OnPostConfirmationAsync(string returnU
await _emailSender.SendEmailAsync(Input.Email, "Confirm your email",
$"Please confirm your account by <a href='{HtmlEncoder.Default.Encode(callbackUrl)}'>clicking here</a>.");

// If account confirmation is required, we need to show the link if we don't have a real email sender
if (_userManager.Options.SignIn.RequireConfirmedAccount)
{
return RedirectToPage("./RegisterConfirmation", new { Email = Input.Email });
}

await _signInManager.SignInAsync(user, isPersistent: false);
return LocalRedirect(returnUrl);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

using System;
using System.Threading.Tasks;
using Identity.DefaultUI.WebSite;
using Microsoft.AspNetCore.Identity.UI.Services;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
Expand Down Expand Up @@ -156,10 +155,9 @@ void ConfigureTestServices(IServiceCollection services)
public async Task CanRegisterWithASocialLoginProviderFromLoginWithConfirmationAndRealEmailSender()
{
// Arrange
var emailSender = new ContosoEmailSender();
void ConfigureTestServices(IServiceCollection services)
{
services.SetupTestEmailSender(emailSender);
services.AddSingleton<IEmailSender, FakeEmailSender>();
services
.Configure<IdentityOptions>(o => o.SignIn.RequireConfirmedAccount = true)
.SetupTestThirdPartyLogin();
Expand All @@ -175,7 +173,6 @@ void ConfigureTestServices(IServiceCollection services)

// Act & Assert
await UserStories.RegisterNewUserWithSocialLoginWithConfirmationAsync(client, userName, email, hasRealEmailSender: true);
Assert.Single(emailSender.SentEmails);
}

[Fact]
Expand Down