check email validation

This commit is contained in:
Viktor Scharf
2024-09-16 10:32:30 +02:00
parent ac26cd8035
commit 84eb181928
3 changed files with 22 additions and 14 deletions

View File

@@ -70,8 +70,12 @@ class OcmContext implements Context {
/**
* @return string
* @throws Exception
*/
public function getLastFederatedInvitationToken():string {
if (empty($this->invitationToken)) {
throw new Exception(__METHOD__ . " token not found");
}
return $this->invitationToken;
}
@@ -107,8 +111,6 @@ class OcmContext implements Context {
$responseData = \json_decode($response->getBody()->getContents(), true, 512, JSON_THROW_ON_ERROR);
if (isset($responseData["token"])) {
$this->invitationToken = $responseData["token"];
} else {
throw new Exception(__METHOD__ . " response doesn't contain token");
}
return $response;
}