Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update README to correct code snippets and add resend OTP endpoint #1895

Merged
merged 1 commit into from
Jan 14, 2025
Merged
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
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
Loading