Fixed demo account creation. fixes #167
This commit is contained in:
@@ -33,9 +33,9 @@ namespace Auth
|
||||
Database::User::pointer user {Database::User::getByLoginName(session, loginName)};
|
||||
if (!user)
|
||||
{
|
||||
const Database::User::Type type {Database::User::getCount(session) == 0 ? Database::User::Type::ADMIN : Database::User::Type::REGULAR};
|
||||
const Database::UserType type {Database::User::getCount(session) == 0 ? Database::UserType::ADMIN : Database::UserType::REGULAR};
|
||||
|
||||
LMS_LOG(AUTH, DEBUG) << "Creating user '" << loginName << "', admin = " << (type == Database::User::Type::ADMIN);
|
||||
LMS_LOG(AUTH, DEBUG) << "Creating user '" << loginName << "', admin = " << (type == Database::UserType::ADMIN);
|
||||
|
||||
user = Database::User::create(session, loginName);
|
||||
user.modify()->setType(type);
|
||||
|
||||
@@ -81,9 +81,18 @@ namespace Auth
|
||||
}
|
||||
|
||||
bool
|
||||
InternalPasswordService::isPasswordSecureEnough(std::string_view loginName, std::string_view password) const
|
||||
InternalPasswordService::isPasswordSecureEnough(std::string_view password, const PasswordValidationContext& context) const
|
||||
{
|
||||
return _validator.evaluateStrength(std::string {password}, std::string {loginName}, "").isValid();
|
||||
switch (context.userType)
|
||||
{
|
||||
case Database::UserType::ADMIN:
|
||||
case Database::UserType::REGULAR:
|
||||
return _validator.evaluateStrength(std::string {password}, context.loginName, "").isValid();
|
||||
case Database::UserType::DEMO:
|
||||
return true; // no constraint
|
||||
}
|
||||
|
||||
throw NotImplementedException {};
|
||||
}
|
||||
|
||||
void
|
||||
@@ -97,7 +106,7 @@ namespace Auth
|
||||
if (!user)
|
||||
throw Exception {"User not found!"};
|
||||
|
||||
if (!isPasswordSecureEnough(user->getLoginName(), newPassword))
|
||||
if (!isPasswordSecureEnough(newPassword, PasswordValidationContext {user->getLoginName(), user->getType()} ))
|
||||
throw PasswordTooWeakException {};
|
||||
|
||||
user.modify()->setPasswordHash(passwordHash);
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace Auth
|
||||
std::string_view password) override;
|
||||
|
||||
bool canSetPasswords() const override;
|
||||
bool isPasswordSecureEnough(std::string_view loginName, std::string_view password) const override;
|
||||
bool isPasswordSecureEnough(std::string_view loginName, const PasswordValidationContext& context) const override;
|
||||
void setPassword(Database::Session& session, Database::IdType userId, std::string_view newPassword) override;
|
||||
|
||||
Database::User::PasswordHash hashPassword(std::string_view password) const;
|
||||
|
||||
@@ -187,7 +187,7 @@ namespace Auth
|
||||
}
|
||||
|
||||
bool
|
||||
PAMPasswordService::isPasswordSecureEnough(std::string_view, std::string_view) const
|
||||
PAMPasswordService::isPasswordSecureEnough(std::string_view, const PasswordValidationContext&) const
|
||||
{
|
||||
throw NotImplementedException {};
|
||||
}
|
||||
|
||||
@@ -36,8 +36,7 @@ namespace Auth
|
||||
std::string_view password) override;
|
||||
|
||||
bool canSetPasswords() const override;
|
||||
bool isPasswordSecureEnough(std::string_view loginName,
|
||||
std::string_view password) const override;
|
||||
bool isPasswordSecureEnough(std::string_view loginName, const PasswordValidationContext& context) const override;
|
||||
void setPassword(Database::Session& session,
|
||||
Database::IdType userId,
|
||||
std::string_view newPassword) override;
|
||||
|
||||
@@ -61,14 +61,9 @@ namespace Auth
|
||||
std::string_view loginName,
|
||||
std::string_view password) = 0;
|
||||
|
||||
class PasswordTooWeakException : public Auth::Exception
|
||||
{
|
||||
public:
|
||||
PasswordTooWeakException() : Auth::Exception {"Password too weak"} {}
|
||||
};
|
||||
|
||||
virtual bool canSetPasswords() const = 0;
|
||||
virtual bool isPasswordSecureEnough(std::string_view username, std::string_view password) const = 0;
|
||||
|
||||
virtual bool isPasswordSecureEnough(std::string_view password, const PasswordValidationContext& context) const = 0;
|
||||
virtual void setPassword(Database::Session& session, Database::IdType userId, std::string_view newPassword) = 0;
|
||||
};
|
||||
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include "database/Types.hpp"
|
||||
#include "utils/Exception.hpp"
|
||||
|
||||
namespace Auth
|
||||
@@ -33,5 +35,17 @@ namespace Auth
|
||||
public:
|
||||
NotImplementedException() : Auth::Exception {"Not implemented"} {}
|
||||
};
|
||||
|
||||
struct PasswordValidationContext
|
||||
{
|
||||
std::string loginName;
|
||||
Database::UserType userType;
|
||||
};
|
||||
|
||||
class PasswordTooWeakException : public Exception
|
||||
{
|
||||
public:
|
||||
PasswordTooWeakException() : Auth::Exception {"Password too weak"} {}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ User::getDemo(Session& session)
|
||||
{
|
||||
session.checkSharedLocked();
|
||||
|
||||
pointer res = session.getDboSession().find<User>().where("type = ?").bind(Type::DEMO);
|
||||
pointer res = session.getDboSession().find<User>().where("type = ?").bind(UserType::DEMO);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -70,5 +70,13 @@ namespace Database
|
||||
Internal = 0,
|
||||
ListenBrainz = 1,
|
||||
};
|
||||
|
||||
// Do not change enum values!
|
||||
enum class UserType
|
||||
{
|
||||
REGULAR = 0,
|
||||
ADMIN = 1,
|
||||
DEMO = 2,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -80,15 +80,6 @@ class User : public Wt::Dbo::Dbo<User>
|
||||
public:
|
||||
using pointer = Wt::Dbo::ptr<User>;
|
||||
|
||||
|
||||
// Do not change enum values!
|
||||
enum class Type
|
||||
{
|
||||
REGULAR = 0,
|
||||
ADMIN = 1,
|
||||
DEMO = 2,
|
||||
};
|
||||
|
||||
struct PasswordHash
|
||||
{
|
||||
std::string salt;
|
||||
@@ -152,7 +143,7 @@ class User : public Wt::Dbo::Dbo<User>
|
||||
// write
|
||||
void setLastLogin(const Wt::WDateTime& dateTime) { _lastLogin = dateTime; }
|
||||
void setPasswordHash(const PasswordHash& passwordHash) { _passwordSalt = passwordHash.salt; _passwordHash = passwordHash.hash; }
|
||||
void setType(Type type) { _type = type; }
|
||||
void setType(UserType type) { _type = type; }
|
||||
void setSubsonicTranscodeEnable(bool value) { _subsonicTranscodeEnable = value; }
|
||||
void setSubsonicTranscodeFormat(AudioFormat encoding) { _subsonicTranscodeFormat = encoding; }
|
||||
void setSubsonicTranscodeBitrate(Bitrate bitrate);
|
||||
@@ -166,8 +157,9 @@ class User : public Wt::Dbo::Dbo<User>
|
||||
void setListenBrainzToken(const std::optional<UUID>& MBID) { _listenbrainzToken = MBID ? MBID->getAsString() : ""; }
|
||||
|
||||
// read
|
||||
bool isAdmin() const { return _type == Type::ADMIN; }
|
||||
bool isDemo() const { return _type == Type::DEMO; }
|
||||
bool isAdmin() const { return _type == UserType::ADMIN; }
|
||||
bool isDemo() const { return _type == UserType::DEMO; }
|
||||
UserType getType() const { return _type; }
|
||||
bool getSubsonicTranscodeEnable() const { return _subsonicTranscodeEnable; }
|
||||
AudioFormat getSubsonicTranscodeFormat() const { return _subsonicTranscodeFormat; }
|
||||
Bitrate getSubsonicTranscodeBitrate() const { return _subsonicTranscodeBitrate; }
|
||||
@@ -233,7 +225,7 @@ class User : public Wt::Dbo::Dbo<User>
|
||||
std::string _listenbrainzToken; // Musicbrainz Identifier
|
||||
|
||||
// Admin defined settings
|
||||
Type _type {Type::REGULAR};
|
||||
UserType _type {UserType::REGULAR};
|
||||
|
||||
// User defined settings
|
||||
SubsonicArtistListMode _subsonicArtistListMode {defaultSubsonicArtistListMode};
|
||||
|
||||
@@ -180,7 +180,7 @@ std::string parameterMapToDebugString(const Wt::Http::ParameterMap& parameterMap
|
||||
auto censorValue = [](const std::string& type, const std::string& value) -> std::string
|
||||
{
|
||||
if (type == "p" || type == "password")
|
||||
return "*SENSIBLE DATA*";
|
||||
return "*REDACTED*";
|
||||
else
|
||||
return value;
|
||||
};
|
||||
@@ -221,24 +221,16 @@ checkUserIsMySelfOrAdmin(RequestContext& context, const std::string& username)
|
||||
|
||||
static
|
||||
void
|
||||
checkUserIsAdmin(RequestContext& context)
|
||||
checkUserTypeIsAllowed(RequestContext& context, EnumSet<Database::UserType> allowedUserTypes)
|
||||
{
|
||||
LMS_LOG(API_SUBSONIC, DEBUG) << "Check user is admin";
|
||||
|
||||
auto transaction {context.dbSession.createSharedTransaction()};
|
||||
|
||||
User::pointer currentUser {User::getById(context.dbSession, context.userId)};
|
||||
if (!currentUser)
|
||||
{
|
||||
LMS_LOG(API_SUBSONIC, DEBUG) << "NOT FOUND";
|
||||
throw RequestedDataNotFoundError {};
|
||||
}
|
||||
|
||||
if (!currentUser->isAdmin())
|
||||
{
|
||||
LMS_LOG(API_SUBSONIC, DEBUG) << "NOT ADMIN";
|
||||
if (!allowedUserTypes.contains(currentUser->getType()))
|
||||
throw UserNotAuthorizedError {};
|
||||
}
|
||||
}
|
||||
|
||||
static
|
||||
@@ -567,7 +559,7 @@ handleChangePassword(RequestContext& context)
|
||||
|
||||
Service<Auth::IPasswordService>::get()->setPassword(context.dbSession, userId, password);
|
||||
}
|
||||
catch (Auth::IPasswordService::PasswordTooWeakException&)
|
||||
catch (Auth::PasswordTooWeakException&)
|
||||
{
|
||||
throw PasswordTooWeakGenericError {};
|
||||
}
|
||||
@@ -666,7 +658,7 @@ handleCreateUserRequest(RequestContext& context)
|
||||
{
|
||||
Service<Auth::IPasswordService>::get()->setPassword(context.dbSession, userId, password);
|
||||
}
|
||||
catch (const Auth::IPasswordService::PasswordTooWeakException&)
|
||||
catch (const Auth::PasswordTooWeakException&)
|
||||
{
|
||||
removeCreatedUser();
|
||||
throw PasswordTooWeakGenericError {};
|
||||
@@ -1719,7 +1711,7 @@ handleUpdateUserRequest(RequestContext& context)
|
||||
{
|
||||
Service<::Auth::IPasswordService>()->setPassword(context.dbSession, userId, decodePasswordIfNeeded(*password));
|
||||
}
|
||||
catch (const Auth::IPasswordService::PasswordTooWeakException&)
|
||||
catch (const Auth::PasswordTooWeakException&)
|
||||
{
|
||||
throw PasswordTooWeakGenericError {};
|
||||
}
|
||||
@@ -1922,114 +1914,114 @@ using RequestHandlerFunc = std::function<Response(RequestContext& context)>;
|
||||
using CheckImplementedFunc = std::function<void()>;
|
||||
struct RequestEntryPointInfo
|
||||
{
|
||||
RequestHandlerFunc func;
|
||||
bool mustBeAdmin;
|
||||
CheckImplementedFunc checkFunc {};
|
||||
RequestHandlerFunc func;
|
||||
EnumSet<Database::UserType> allowedUserTypes {Database::UserType::DEMO, Database::UserType::REGULAR, Database::UserType::ADMIN};
|
||||
CheckImplementedFunc checkFunc {};
|
||||
};
|
||||
|
||||
static std::unordered_map<std::string, RequestEntryPointInfo> requestEntryPoints
|
||||
{
|
||||
// System
|
||||
{"ping", {handlePingRequest, false}},
|
||||
{"getLicense", {handleGetLicenseRequest, false}},
|
||||
{"ping", {handlePingRequest}},
|
||||
{"getLicense", {handleGetLicenseRequest}},
|
||||
|
||||
// Browsing
|
||||
{"getMusicFolders", {handleGetMusicFoldersRequest, false}},
|
||||
{"getIndexes", {handleGetIndexesRequest, false}},
|
||||
{"getMusicDirectory", {handleGetMusicDirectoryRequest, false}},
|
||||
{"getGenres", {handleGetGenresRequest, false}},
|
||||
{"getArtists", {handleGetArtistsRequest, false}},
|
||||
{"getArtist", {handleGetArtistRequest, false}},
|
||||
{"getAlbum", {handleGetAlbumRequest, false}},
|
||||
{"getSong", {handleNotImplemented, false}},
|
||||
{"getVideos", {handleNotImplemented, false}},
|
||||
{"getArtistInfo", {handleGetArtistInfoRequest, false}},
|
||||
{"getArtistInfo2", {handleGetArtistInfo2Request, false}},
|
||||
{"getAlbumInfo", {handleNotImplemented, false}},
|
||||
{"getAlbumInfo2", {handleNotImplemented, false}},
|
||||
{"getSimilarSongs", {handleGetSimilarSongsRequest, false}},
|
||||
{"getSimilarSongs2", {handleGetSimilarSongs2Request, false}},
|
||||
{"getTopSongs", {handleNotImplemented, false}},
|
||||
{"getMusicFolders", {handleGetMusicFoldersRequest}},
|
||||
{"getIndexes", {handleGetIndexesRequest}},
|
||||
{"getMusicDirectory", {handleGetMusicDirectoryRequest}},
|
||||
{"getGenres", {handleGetGenresRequest}},
|
||||
{"getArtists", {handleGetArtistsRequest}},
|
||||
{"getArtist", {handleGetArtistRequest}},
|
||||
{"getAlbum", {handleGetAlbumRequest}},
|
||||
{"getSong", {handleNotImplemented}},
|
||||
{"getVideos", {handleNotImplemented}},
|
||||
{"getArtistInfo", {handleGetArtistInfoRequest}},
|
||||
{"getArtistInfo2", {handleGetArtistInfo2Request}},
|
||||
{"getAlbumInfo", {handleNotImplemented}},
|
||||
{"getAlbumInfo2", {handleNotImplemented}},
|
||||
{"getSimilarSongs", {handleGetSimilarSongsRequest}},
|
||||
{"getSimilarSongs2", {handleGetSimilarSongs2Request}},
|
||||
{"getTopSongs", {handleNotImplemented}},
|
||||
|
||||
// Album/song lists
|
||||
{"getAlbumList", {handleGetAlbumListRequest, false}},
|
||||
{"getAlbumList2", {handleGetAlbumList2Request, false}},
|
||||
{"getRandomSongs", {handleGetRandomSongsRequest, false}},
|
||||
{"getSongsByGenre", {handleGetSongsByGenreRequest, false}},
|
||||
{"getNowPlaying", {handleNotImplemented, false}},
|
||||
{"getStarred", {handleGetStarredRequest, false}},
|
||||
{"getStarred2", {handleGetStarred2Request, false}},
|
||||
{"getAlbumList", {handleGetAlbumListRequest}},
|
||||
{"getAlbumList2", {handleGetAlbumList2Request}},
|
||||
{"getRandomSongs", {handleGetRandomSongsRequest}},
|
||||
{"getSongsByGenre", {handleGetSongsByGenreRequest}},
|
||||
{"getNowPlaying", {handleNotImplemented}},
|
||||
{"getStarred", {handleGetStarredRequest}},
|
||||
{"getStarred2", {handleGetStarred2Request}},
|
||||
|
||||
// Searching
|
||||
{"search", {handleNotImplemented, false}},
|
||||
{"search2", {handleSearch2Request, false}},
|
||||
{"search3", {handleSearch3Request, false}},
|
||||
{"search", {handleNotImplemented}},
|
||||
{"search2", {handleSearch2Request}},
|
||||
{"search3", {handleSearch3Request}},
|
||||
|
||||
// Playlists
|
||||
{"getPlaylists", {handleGetPlaylistsRequest, false}},
|
||||
{"getPlaylist", {handleGetPlaylistRequest, false}},
|
||||
{"createPlaylist", {handleCreatePlaylistRequest, false}},
|
||||
{"updatePlaylist", {handleUpdatePlaylistRequest, false}},
|
||||
{"deletePlaylist", {handleDeletePlaylistRequest, false}},
|
||||
{"getPlaylists", {handleGetPlaylistsRequest}},
|
||||
{"getPlaylist", {handleGetPlaylistRequest}},
|
||||
{"createPlaylist", {handleCreatePlaylistRequest}},
|
||||
{"updatePlaylist", {handleUpdatePlaylistRequest}},
|
||||
{"deletePlaylist", {handleDeletePlaylistRequest}},
|
||||
|
||||
// Media retrieval
|
||||
{"hls", {handleNotImplemented, false}},
|
||||
{"getCaptions", {handleNotImplemented, false}},
|
||||
{"getLyrics", {handleNotImplemented, false}},
|
||||
{"getAvatar", {handleNotImplemented, false}},
|
||||
{"hls", {handleNotImplemented}},
|
||||
{"getCaptions", {handleNotImplemented}},
|
||||
{"getLyrics", {handleNotImplemented}},
|
||||
{"getAvatar", {handleNotImplemented}},
|
||||
|
||||
// Media annotation
|
||||
{"star", {handleStarRequest, false}},
|
||||
{"unstar", {handleUnstarRequest, false}},
|
||||
{"setRating", {handleNotImplemented, false}},
|
||||
{"scrobble", {handleScrobble, false}},
|
||||
{"star", {handleStarRequest}},
|
||||
{"unstar", {handleUnstarRequest}},
|
||||
{"setRating", {handleNotImplemented}},
|
||||
{"scrobble", {handleScrobble}},
|
||||
|
||||
// Sharing
|
||||
{"getShares", {handleNotImplemented, false}},
|
||||
{"createShares", {handleNotImplemented, false}},
|
||||
{"updateShare", {handleNotImplemented, false}},
|
||||
{"deleteShare", {handleNotImplemented, false}},
|
||||
{"getShares", {handleNotImplemented}},
|
||||
{"createShares", {handleNotImplemented}},
|
||||
{"updateShare", {handleNotImplemented}},
|
||||
{"deleteShare", {handleNotImplemented}},
|
||||
|
||||
// Podcast
|
||||
{"getPodcasts", {handleNotImplemented, false}},
|
||||
{"getNewestPodcasts", {handleNotImplemented, false}},
|
||||
{"refreshPodcasts", {handleNotImplemented, false}},
|
||||
{"createPodcastChannel", {handleNotImplemented, false}},
|
||||
{"deletePodcastChannel", {handleNotImplemented, false}},
|
||||
{"deletePodcastEpisode", {handleNotImplemented, false}},
|
||||
{"downloadPodcastEpisode", {handleNotImplemented, false}},
|
||||
{"getPodcasts", {handleNotImplemented}},
|
||||
{"getNewestPodcasts", {handleNotImplemented}},
|
||||
{"refreshPodcasts", {handleNotImplemented}},
|
||||
{"createPodcastChannel", {handleNotImplemented}},
|
||||
{"deletePodcastChannel", {handleNotImplemented}},
|
||||
{"deletePodcastEpisode", {handleNotImplemented}},
|
||||
{"downloadPodcastEpisode", {handleNotImplemented}},
|
||||
|
||||
// Jukebox
|
||||
{"jukeboxControl", {handleNotImplemented, false}},
|
||||
{"jukeboxControl", {handleNotImplemented}},
|
||||
|
||||
// Internet radio
|
||||
{"getInternetRadioStations", {handleNotImplemented, false}},
|
||||
{"createInternetRadioStation", {handleNotImplemented, false}},
|
||||
{"updateInternetRadioStation", {handleNotImplemented, false}},
|
||||
{"deleteInternetRadioStation", {handleNotImplemented, false}},
|
||||
{"getInternetRadioStations", {handleNotImplemented}},
|
||||
{"createInternetRadioStation", {handleNotImplemented}},
|
||||
{"updateInternetRadioStation", {handleNotImplemented}},
|
||||
{"deleteInternetRadioStation", {handleNotImplemented}},
|
||||
|
||||
// Chat
|
||||
{"getChatMessages", {handleNotImplemented, false}},
|
||||
{"addChatMessages", {handleNotImplemented, false}},
|
||||
{"getChatMessages", {handleNotImplemented}},
|
||||
{"addChatMessages", {handleNotImplemented}},
|
||||
|
||||
// User management
|
||||
{"getUser", {handleGetUserRequest, false}},
|
||||
{"getUsers", {handleGetUsersRequest, true}},
|
||||
{"createUser", {handleCreateUserRequest, true, &checkSetPasswordImplemented}},
|
||||
{"updateUser", {handleUpdateUserRequest, true}},
|
||||
{"deleteUser", {handleDeleteUserRequest, true}},
|
||||
{"changePassword", {handleChangePassword, false, &checkSetPasswordImplemented}},
|
||||
{"getUser", {handleGetUserRequest}},
|
||||
{"getUsers", {handleGetUsersRequest, {Database::UserType::ADMIN}}},
|
||||
{"createUser", {handleCreateUserRequest, {Database::UserType::ADMIN}, &checkSetPasswordImplemented}},
|
||||
{"updateUser", {handleUpdateUserRequest, {Database::UserType::ADMIN}}},
|
||||
{"deleteUser", {handleDeleteUserRequest, {Database::UserType::ADMIN}}},
|
||||
{"changePassword", {handleChangePassword, {Database::UserType::REGULAR, Database::UserType::ADMIN}, &checkSetPasswordImplemented}},
|
||||
|
||||
// Bookmarks
|
||||
{"getBookmarks", {handleGetBookmarks, false}},
|
||||
{"createBookmark", {handleCreateBookmark, false}},
|
||||
{"deleteBookmark", {handleDeleteBookmark, false}},
|
||||
{"getPlayQueue", {handleNotImplemented, false}},
|
||||
{"savePlayQueue", {handleNotImplemented, false}},
|
||||
{"getBookmarks", {handleGetBookmarks}},
|
||||
{"createBookmark", {handleCreateBookmark}},
|
||||
{"deleteBookmark", {handleDeleteBookmark}},
|
||||
{"getPlayQueue", {handleNotImplemented}},
|
||||
{"savePlayQueue", {handleNotImplemented}},
|
||||
|
||||
// Media library scanning
|
||||
{"getScanStatus", {Scan::handleGetScanStatus, true}},
|
||||
{"startScan", {Scan::handleStartScan, true}},
|
||||
{"getScanStatus", {Scan::handleGetScanStatus, {Database::UserType::ADMIN}}},
|
||||
{"startScan", {Scan::handleStartScan, {Database::UserType::ADMIN}}},
|
||||
};
|
||||
|
||||
using MediaRetrievalHandlerFunc = std::function<void(RequestContext&, const Wt::Http::Request&, Wt::Http::Response&)>;
|
||||
@@ -2112,8 +2104,7 @@ SubsonicResource::handleRequest(const Wt::Http::Request &request, Wt::Http::Resp
|
||||
if (itEntryPoint->second.checkFunc)
|
||||
itEntryPoint->second.checkFunc();
|
||||
|
||||
if (itEntryPoint->second.mustBeAdmin)
|
||||
checkUserIsAdmin(requestContext);
|
||||
checkUserTypeIsAllowed(requestContext, itEntryPoint->second.allowedUserTypes);
|
||||
|
||||
Response resp {(itEntryPoint->second.func)(requestContext)};
|
||||
|
||||
|
||||
@@ -152,6 +152,11 @@ class PasswordTooWeakGenericError : public GenericError
|
||||
std::string getMessage() const override { return "Password too weak"; }
|
||||
};
|
||||
|
||||
class DemoUserCannotChangePasswordGenericError : public GenericError
|
||||
{
|
||||
std::string getMessage() const override { return "Demo user cannot change its password"; }
|
||||
};
|
||||
|
||||
class UserAlreadyExistsGenericError : public GenericError
|
||||
{
|
||||
std::string getMessage() const override { return "User already exists"; }
|
||||
|
||||
Reference in New Issue
Block a user