aspnet / Identity

[Archived] ASP.NET Core Identity is the membership system for building ASP.NET Core web applications, including membership, login, and user data. Project moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
1.96k stars 868 forks source link

Login doesn't show registered social logins after error #2074

Closed wpqs closed 5 years ago

wpqs commented 5 years ago

I'm using ASPNET Core 2.1 with Razor Pages UI Library and noticed that whilst registered social logins appear when I open the Login page, they disappear after an error like incorrect password.

There seems to be a bug in Identity\Pages\Account\Login.cshtml.cs as

 public IList<AuthenticationScheme> ExternalLogins { get; set; }

is only initialised in OnGetAsync(), but if an error happens OnPostAsync() then Page() is returned so OnGetAsyn() doesn't get called. Changing error handling in OnPostAsync() so RedirectToPage() is returned seems to fix the problem.

Please confirm this is a bug and comment on my fix

blowdart commented 5 years ago

Dupe of https://github.com/aspnet/Identity/issues/1636