protocols/activation: send an invalid token when serial isn't valid (#11505)
This commit is contained in:
parent
0d45b277d6
commit
d9cf1cb78e
1 changed files with 7 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
#include "XDGActivation.hpp"
|
#include "XDGActivation.hpp"
|
||||||
#include "../managers/TokenManager.hpp"
|
#include "../managers/TokenManager.hpp"
|
||||||
#include "../Compositor.hpp"
|
#include "../Compositor.hpp"
|
||||||
|
#include "../managers/SeatManager.hpp"
|
||||||
#include "core/Compositor.hpp"
|
#include "core/Compositor.hpp"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
|
@ -23,6 +24,12 @@ CXDGActivationToken::CXDGActivationToken(SP<CXdgActivationTokenV1> resource_) :
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!g_pSeatManager->serialValid(g_pSeatManager->seatResourceForClient(m_resource->client()), m_serial)) {
|
||||||
|
LOGM(LOG, "serial not found, sending invalid token");
|
||||||
|
m_resource->sendDone("__invalid__");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
m_committed = true;
|
m_committed = true;
|
||||||
// send done with a new token
|
// send done with a new token
|
||||||
m_token = g_pTokenManager->registerNewToken({}, std::chrono::months{12});
|
m_token = g_pTokenManager->registerNewToken({}, std::chrono::months{12});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue