This commit is contained in:
Hemachandar
2025-09-18 14:09:42 +05:30
parent 2021396f39
commit 0812ac97a9
3 changed files with 14 additions and 1 deletions
+1 -1
View File
@@ -73,7 +73,7 @@ $console = [
"signature" => "{{project}} team",
],
'email.otpSession-en' => [
'subject' => 'OTP for {{project}} account login',
'subject' => 'OTP for {{project}} Login',
'preview' => 'Use OTP {{otp}} to sign in to {{project}}. Expires in 15 minutes.',
'heading' => 'Login with OTP to use Appwrite Cloud',
'hello' => 'Hello {{user}},',
@@ -144,6 +144,7 @@
<img
height="32px"
src="{{logoUrl}}"
alt="Appwrite logo"
/>
</td>
</tr>
@@ -152,6 +152,8 @@ trait AccountBase
public function testEmailOTPSession(): void
{
$isConsoleProject = $this->getProject()['$id'] === 'console';
$response = $this->client->call(Client::METHOD_POST, '/account/tokens/email', array_merge([
'origin' => 'http://localhost',
'content-type' => 'application/json',
@@ -183,6 +185,16 @@ trait AccountBase
$this->assertNotEmpty($code);
$this->assertStringContainsStringIgnoringCase('Use OTP ' . $code . ' to sign in to '. $this->getProject()['name'] . '. Expires in 15 minutes.', $lastEmail['text']);
// Only Console project has branded logo in email.
if ($isConsoleProject) {
$this->assertStringContainsStringIgnoringCase('Appwrite logo', $lastEmail['html']);
}
// TODO: Remove this once OTP login is supported for Console.
if ($isConsoleProject) {
return;
}
$response = $this->client->call(Client::METHOD_POST, '/account/sessions/token', array_merge([
'origin' => 'http://localhost',
'content-type' => 'application/json',