From fdf9da12aa5ef0ce72f562f85a9f2befd059545c Mon Sep 17 00:00:00 2001 From: netkas Date: Fri, 31 Jan 2025 22:33:51 -0500 Subject: [PATCH] Updated method Authenticate to do one additional check --- .../StandardMethods/Verification/Authenticate.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Socialbox/Classes/StandardMethods/Verification/Authenticate.php b/src/Socialbox/Classes/StandardMethods/Verification/Authenticate.php index c52d689..03bea68 100644 --- a/src/Socialbox/Classes/StandardMethods/Verification/Authenticate.php +++ b/src/Socialbox/Classes/StandardMethods/Verification/Authenticate.php @@ -26,7 +26,14 @@ return $rpcRequest->produceError(StandardError::FORBIDDEN, 'Only external peers can authenticate using this method'); } - SessionManager::updateFlow($request->getSession(), [SessionFlags::AUTHENTICATION_REQUIRED]); + $session = $request->getSession(); + + if(!$session->flagExists(SessionFlags::AUTHENTICATION_REQUIRED)) + { + return $rpcRequest->produceResponse(false); + } + + SessionManager::updateFlow($session, [SessionFlags::AUTHENTICATION_REQUIRED]); } catch(Exception $e) {