Skip to content

Commit

Permalink
docs: update README to correct code snippets and add resend OTP endpo…
Browse files Browse the repository at this point in the history
…int (#1895)

## What kind of change does this PR introduce?

docs: update README to correct code snippets and add resend OTP
endpoint. fix #1711
  • Loading branch information
12138zhen authored Jan 14, 2025
1 parent daa7e37 commit 586df26
Showing 1 changed file with 32 additions and 4 deletions.
36 changes: 32 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ Returns

Register a new user with an email and password.

```js
```json
{
"email": "[email protected]",
"password": "secret"
Expand Down Expand Up @@ -866,13 +866,39 @@ Returns:

if AUTOCONFIRM is enabled and the sign up is a duplicate, then the endpoint will return:

```
```json
{
"code":400,
"msg":"User already registered"
}
```

### **POST /resend**

Allows a user to resend an existing signup, sms, email_change or phone_change OTP.

```json
{
"email": "[email protected]",
"type": "signup"
}
```

```json
{
"phone": "12345678",
"type": "sms"
}
```

returns:

```json
{
"message_id": "msgid123456"
}
```

### **POST /invite**

Invites a new user with an email.
Expand Down Expand Up @@ -985,14 +1011,16 @@ One-Time-Password. Will deliver a magiclink or sms otp to the user depending on

If `"create_user": true`, user will not be automatically signed up if the user doesn't exist.

```js
```json
{
"phone": "12345678" // follows the E.164 format
"create_user": true
}
```

OR

```json
// exactly the same as /magiclink
{
"email": "[email protected]"
Expand All @@ -1002,7 +1030,7 @@ OR

Returns:

```
```json
{}
```

Expand Down

0 comments on commit 586df26

Please sign in to comment.