mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-30 19:54:16 -04:00
Add no password login error message
This commit is contained in:
parent
ef0260f3f5
commit
2ee71f8d8f
@ -211,6 +211,12 @@ public class AuthApi(
|
|||||||
User? user = await users.GetOrDefault(
|
User? user = await users.GetOrDefault(
|
||||||
new Filter<User>.Eq(nameof(Abstractions.Models.User.Username), request.Username)
|
new Filter<User>.Eq(nameof(Abstractions.Models.User.Username), request.Username)
|
||||||
);
|
);
|
||||||
|
if (user != null && user.Password == null)
|
||||||
|
return Forbid(
|
||||||
|
new RequestError(
|
||||||
|
"This account was registerd via oidc. Please login via oidc or add a password to your account in the settings first"
|
||||||
|
)
|
||||||
|
);
|
||||||
if (user == null || !BCryptNet.Verify(request.Password, user.Password))
|
if (user == null || !BCryptNet.Verify(request.Password, user.Password))
|
||||||
return Forbid(new RequestError("The user and password does not match."));
|
return Forbid(new RequestError("The user and password does not match."));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user