Skip to content

Commit ed20003

Browse files
authored
Merge pull request #498 from iceljc/bugfix/fix-user-login
fix login
2 parents 9d0c9c2 + e81d862 commit ed20003

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Infrastructure/BotSharp.Core/Users/Services/UserService.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ record = db.GetUserByUserName(id);
9696
}
9797

9898
User? user = record;
99+
var isAuthenticatedByHook = false;
99100
var hooks = _services.GetServices<IAuthenticationHook>();
100101
if (record == null || record.Source != "internal")
101102
{
@@ -129,6 +130,8 @@ record = db.GetUserByUserName(id);
129130
};
130131
await CreateUser(record);
131132
}
133+
134+
isAuthenticatedByHook = true;
132135
break;
133136
}
134137
}
@@ -138,13 +141,13 @@ record = db.GetUserByUserName(id);
138141
return default;
139142
}
140143

141-
if (_setting.NewUserVerification && !record.Verified)
144+
if (!isAuthenticatedByHook && _setting.NewUserVerification && !record.Verified)
142145
{
143146
return default;
144147
}
145148

146149
#if !DEBUG
147-
if (Utilities.HashText(password, record.Salt) != record.Password)
150+
if (!isAuthenticatedByHook && Utilities.HashText(password, record.Salt) != record.Password)
148151
{
149152
return default;
150153
}

0 commit comments

Comments
 (0)