Skip to content

Commit 73b843a

Browse files
committed
Add 1.8.x support
1 parent 8f0dd23 commit 73b843a

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

docs/account.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -510,15 +510,16 @@ PATCH https://cloud.appwrite.io/v1/account/status
510510
POST https://cloud.appwrite.io/v1/account/tokens/email
511511
```
512512

513-
** Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.
513+
** Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided `userId`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.
514514

515-
A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). **
515+
A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
516+
**
516517

517518
### Parameters
518519

519520
| Field Name | Type | Description | Default |
520521
| --- | --- | --- | --- |
521-
| userId | string | User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | |
522+
| userId | string | User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored. | |
522523
| email | string | User email. | |
523524
| phrase | boolean | Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow. | |
524525

@@ -536,7 +537,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
536537

537538
| Field Name | Type | Description | Default |
538539
| --- | --- | --- | --- |
539-
| userId | string | Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | |
540+
| userId | string | Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored. | |
540541
| email | string | User email. | |
541542
| url | string | URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. | |
542543
| phrase | boolean | Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow. | |
@@ -574,7 +575,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
574575

575576
| Field Name | Type | Description | Default |
576577
| --- | --- | --- | --- |
577-
| userId | string | Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | |
578+
| userId | string | Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the phone number has never been used, a new account is created using the provided userId. Otherwise, if the phone number is already attached to an account, the user ID is ignored. | |
578579
| phone | string | Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. | |
579580

580581

src/Appwrite/Services/Account.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,15 +1444,19 @@ public function updateStatus(): array
14441444

14451445
/**
14461446
* Sends the user an email with a secret key for creating a session. If the
1447-
* provided user ID has not be registered, a new user will be created. Use the
1448-
* returned user ID and secret and submit a request to the [POST
1447+
* email address has never been used, a **new account is created** using the
1448+
* provided `userId`. Otherwise, if the email address is already attached to
1449+
* an account, the **user ID is ignored**. Then, the user will receive an
1450+
* email with the one-time password. Use the returned user ID and secret and
1451+
* submit a request to the [POST
14491452
* /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession)
14501453
* endpoint to complete the login process. The secret sent to the user's email
14511454
* is valid for 15 minutes.
14521455
*
14531456
* A user is limited to 10 active sessions at a time by default. [Learn more
14541457
* about session
14551458
* limits](https://appwrite.io/docs/authentication-security#limits).
1459+
*
14561460
*
14571461
* @param string $userId
14581462
* @param string $email

tests/Appwrite/Services/FunctionsTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,7 @@ public function testMethodCreateExecution(): void {
610610
"\$updatedAt" => "2020-10-15T06:38:00.000+00:00",
611611
"\$permissions" => array(),
612612
"functionId" => "5e5ea6g16897e",
613+
"deploymentId" => "5e5ea5c16897e",
613614
"trigger" => "http",
614615
"status" => "processing",
615616
"requestMethod" => "GET",
@@ -642,6 +643,7 @@ public function testMethodGetExecution(): void {
642643
"\$updatedAt" => "2020-10-15T06:38:00.000+00:00",
643644
"\$permissions" => array(),
644645
"functionId" => "5e5ea6g16897e",
646+
"deploymentId" => "5e5ea5c16897e",
645647
"trigger" => "http",
646648
"status" => "processing",
647649
"requestMethod" => "GET",

tests/Appwrite/Services/SitesTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,7 @@ public function testMethodGetLog(): void {
616616
"\$updatedAt" => "2020-10-15T06:38:00.000+00:00",
617617
"\$permissions" => array(),
618618
"functionId" => "5e5ea6g16897e",
619+
"deploymentId" => "5e5ea5c16897e",
619620
"trigger" => "http",
620621
"status" => "processing",
621622
"requestMethod" => "GET",

0 commit comments

Comments
 (0)