Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## 17.3.0

* Deprecate `createVerification` method in `Account` service
* Add `createEmailVerification` method in `Account` service

## 15.1.0

* Add `incrementDocumentAttribute` and `decrementDocumentAttribute` support to `Databases` service
Expand Down
38 changes: 34 additions & 4 deletions docs/account.md
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about


```http request
POST https://cloud.appwrite.io/v1/account/verification
POST https://cloud.appwrite.io/v1/account/verifications/email
```

** Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.
Expand All @@ -596,7 +596,37 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/


```http request
PUT https://cloud.appwrite.io/v1/account/verification
POST https://cloud.appwrite.io/v1/account/verifications/email
```

** Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.

Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.
**

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| url | string | URL to redirect the user back to your app from the verification email. 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. | |


```http request
PUT https://cloud.appwrite.io/v1/account/verifications/email
```

** Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| userId | string | User ID. | |
| secret | string | Valid verification token. | |


```http request
PUT https://cloud.appwrite.io/v1/account/verifications/email
```

** Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code. **
Expand All @@ -610,14 +640,14 @@ PUT https://cloud.appwrite.io/v1/account/verification


```http request
POST https://cloud.appwrite.io/v1/account/verification/phone
POST https://cloud.appwrite.io/v1/account/verifications/phone
```

** Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](https://appwrite.io/docs/references/cloud/client-web/account#updatePhone) endpoint. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes. **


```http request
PUT https://cloud.appwrite.io/v1/account/verification/phone
PUT https://cloud.appwrite.io/v1/account/verifications/phone
```

** Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code. **
Expand Down
15 changes: 15 additions & 0 deletions docs/examples/account/create-email-verification.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

use Appwrite\Client;
use Appwrite\Services\Account;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with

$account = new Account($client);

$result = $account->createEmailVerification(
url: 'https://example.com'
);
16 changes: 16 additions & 0 deletions docs/examples/account/update-email-verification.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

use Appwrite\Client;
use Appwrite\Services\Account;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with

$account = new Account($client);

$result = $account->updateEmailVerification(
userId: '<USER_ID>',
secret: '<SECRET>'
);
2 changes: 1 addition & 1 deletion docs/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ POST https://cloud.appwrite.io/v1/functions/{functionId}/deployments/template

** Create a deployment based on a template.

Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/server/functions#listTemplates) to find the template details. **
Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/products/functions/templates) to find the template details. **

### Parameters

Expand Down
2 changes: 1 addition & 1 deletion docs/sites.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ POST https://cloud.appwrite.io/v1/sites/{siteId}/deployments/template

** Create a deployment based on a template.

Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/server/sites#listTemplates) to find the template details. **
Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/products/sites/templates) to find the template details. **

### Parameters

Expand Down
Loading