Skip to content
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

social signed-in user assumed as confirmed user (#10239) #10240

Merged
merged 1 commit into from
Mar 14, 2025
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,14 @@ public async Task<ActionResult> SocialSignInCallback(string? returnUrl = null, i

if (user is null)
{
var name = info.Principal.FindFirstValue(ClaimTypes.Name) ?? info.Principal.FindFirstValue(ClaimTypes.NameIdentifier);
// Instead of automatically creating a user here, you can navigate to the sign-up page and pass the email and phone number in the query string.

user = new() { LockoutEnabled = true };
user = new()
{
FullName = name,
LockoutEnabled = true
};

await userStore.SetUserNameAsync(user, Guid.NewGuid().ToString(), cancellationToken);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ public partial class AppUserConfirmation : IUserConfirmation<User>
{
public async Task<bool> IsConfirmedAsync(UserManager<User> manager, User user)
{
return user.EmailConfirmed || user.PhoneNumberConfirmed;
return user.EmailConfirmed ||
user.PhoneNumberConfirmed ||
(await manager.GetLoginsAsync(user)).Any();
}
}
Loading