From 586df26ae7cb9581436682bdb0a8573aa99d59c9 Mon Sep 17 00:00:00 2001 From: Zhenyu Hong <1109115258@qq.com> Date: Wed, 15 Jan 2025 07:33:09 +0800 Subject: [PATCH] docs: update README to correct code snippets and add resend OTP endpoint (#1895) ## What kind of change does this PR introduce? docs: update README to correct code snippets and add resend OTP endpoint. fix #1711 --- README.md | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6ec3367e1c..5b9c702530 100644 --- a/README.md +++ b/README.md @@ -820,7 +820,7 @@ Returns Register a new user with an email and password. -```js +```json { "email": "email@example.com", "password": "secret" @@ -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": "user@example.com", + "type": "signup" +} +``` + +```json +{ + "phone": "12345678", + "type": "sms" +} +``` + +returns: + +```json +{ + "message_id": "msgid123456" +} +``` + ### **POST /invite** Invites a new user with an email. @@ -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@example.com" @@ -1002,7 +1030,7 @@ OR Returns: -``` +```json {} ```