Create password recovery
Sends the user an email with a temporary secret key for password reset.
/account/recoveryScope sessions.writeSends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the PUT /account/recovery endpoint to complete the process. The verification link sent to the user’s email address is valid for 1 hour.
Parameters
Section titled “Parameters”email string required
User email.
url string required
URL to redirect the user back to your app from the recovery email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an open redirect attack against your project API.
Access: no key or session: the project ID is enough.
Responses
Section titled “Responses”201Success400Invalid or missing parameter401No session, no permission on the resource or key without the scope429Rate limitEvery error comes as JSON with code, type and message: see Errors.
import { Client, Account } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const account = new Account(client);
const result = await account.createRecovery({ url: 'https://example.com',});
console.log(result);import { Client, Account } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const account = new Account(client);
const result = await account.createRecovery({ url: 'https://example.com',});curl -X POST "https://cloud.owbase.dev/v1/account/recovery" \ -H "X-Owbase-Project: <PROJECT_ID>" \ -H "X-Owbase-Session: <SESSION>" \ -H "Content-Type: application/json" \ -d '{"email":"<EMAIL>","url":"<URL>"}'{ "$id": "bb8ea5c16897e", "$createdAt": "2020-10-15T06:38:00.000+00:00", "userId": "5e5ea5c168bb8", "secret": "", "expire": "2020-10-15T06:38:00.000+00:00", "phrase": "Golden Fox"}The descriptions on this page come from the server API specification (BSD-3-Clause license), and the examples come from the SDK generator (MIT license). The full notices are in the NOTICE file of the @owbase/web and @owbase/node packages.