Subsonic API: report error 41 for auth token attempts

This commit is contained in:
emeric
2023-01-07 14:50:30 +01:00
parent e848008ceb
commit b681a20b5a
3 changed files with 19 additions and 0 deletions
@@ -48,6 +48,7 @@ class Error
ClientMustUpgrade = 20,
ServerMustUpgrade = 30,
WrongUsernameOrPassword = 40,
TokenAuthenticationNotSupportedForLDAPUsers = 41,
UserNotAuthorized = 50,
RequestedDataNotFound = 70,
};
@@ -105,6 +106,14 @@ class WrongUsernameOrPasswordError : public Error
std::string getMessage() const override { return "Wrong username or password."; }
};
class TokenAuthenticationNotSupportedForLDAPUsersError : public Error
{
public:
TokenAuthenticationNotSupportedForLDAPUsersError() : Error {Code::TokenAuthenticationNotSupportedForLDAPUsers} {}
private:
std::string getMessage() const override { return "Token authentication not supported for LDAP users."; }
};
class UserNotAuthorizedError : public Error
{
public: