Skip to content

Commit 9338395

Browse files
Stripped username before login (#16921)
* Stripped username before login
1 parent 3560fc9 commit 9338395

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Umbraco.Web.Common/Security/UmbracoSignInManager.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ public override async Task<SignInResult> PasswordSignInAsync(TUser user, string
165165
public override async Task<SignInResult> PasswordSignInAsync(string userName, string password, bool isPersistent, bool lockoutOnFailure)
166166
{
167167
// override to handle logging/events
168-
TUser? user = await UserManager.FindByNameAsync(userName);
168+
string strippedUsername = userName.Trim();
169+
TUser? user = await UserManager.FindByNameAsync(strippedUsername);
169170
if (user == null)
170171
{
171172
return await HandleSignIn(null, userName, SignInResult.Failed);

0 commit comments

Comments
 (0)