Made message signing in Cryptography use SHA512 as the message content for... #1
1 changed files with 9 additions and 4 deletions
|
@ -14,17 +14,22 @@
|
|||
class AcceptTermsOfService extends Method
|
||||
{
|
||||
/**
|
||||
* Executes the process of accepting the terms of service.
|
||||
*
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function execute(ClientRequest $request, RpcRequest $rpcRequest): ?SerializableInterface
|
||||
{
|
||||
$session = $request->getSession();
|
||||
if(!$session->flagExists(SessionFlags::VER_TERMS_OF_SERVICE))
|
||||
{
|
||||
return $rpcRequest->produceError(StandardError::FORBIDDEN, 'Terms of service has already been accepted');
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
// Remove the verification flag
|
||||
SessionManager::removeFlags($request->getSessionUuid(), [SessionFlags::VER_TERMS_OF_SERVICE]);
|
||||
|
||||
// Check & update the session flow
|
||||
SessionManager::updateFlow($request->getSession());
|
||||
SessionManager::updateFlow($session, [SessionFlags::VER_TERMS_OF_SERVICE]);
|
||||
}
|
||||
catch (DatabaseOperationException $e)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue