Merge pull request #498 from iceljc/bugfix/fix-user-login

fix login
This commit is contained in:
C. Oceania 2024-06-12 13:43:29 -05:00 committed by GitHub
commit ed2000336d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -96,6 +96,7 @@ public class UserService : IUserService
} }
User? user = record; User? user = record;
var isAuthenticatedByHook = false;
var hooks = _services.GetServices<IAuthenticationHook>(); var hooks = _services.GetServices<IAuthenticationHook>();
if (record == null || record.Source != "internal") if (record == null || record.Source != "internal")
{ {
@ -129,6 +130,8 @@ public class UserService : IUserService
}; };
await CreateUser(record); await CreateUser(record);
} }
isAuthenticatedByHook = true;
break; break;
} }
} }
@ -138,13 +141,13 @@ public class UserService : IUserService
return default; return default;
} }
if (_setting.NewUserVerification && !record.Verified) if (!isAuthenticatedByHook && _setting.NewUserVerification && !record.Verified)
{ {
return default; return default;
} }
#if !DEBUG #if !DEBUG
if (Utilities.HashText(password, record.Salt) != record.Password) if (!isAuthenticatedByHook && Utilities.HashText(password, record.Salt) != record.Password)
{ {
return default; return default;
} }