Add remove user function in basicauthmiddleware

This commit is contained in:
2023-06-09 12:51:42 +02:00
parent 0960b2c7f7
commit 4aba620039
2 changed files with 6 additions and 0 deletions

View File

@@ -61,6 +61,7 @@ public:
* with the new one provided.
*/
void add(const QString &username, const QString &password);
void remove(const QString &username);
/**
* @brief Process the request

View File

@@ -46,6 +46,11 @@ void BasicAuthMiddleware::add(const QString &username, const QString &password)
d->map.insert(username, password);
}
void BasicAuthMiddleware::remove(const QString &username)
{
d->map.remove(username);
}
bool BasicAuthMiddleware::verify(const QString &username, const QString &password)
{
return d->map.contains(username) && d->map.value(username) == password;