updated api preview examples
This commit is contained in:
@@ -11,6 +11,8 @@
|
|||||||
|
|
||||||
- Updated `modernc.org/sqlite` to v1.50.1 (SQLite 3.53.1).
|
- Updated `modernc.org/sqlite` to v1.50.1 (SQLite 3.53.1).
|
||||||
|
|
||||||
|
- Other minor fixes (_updated API preview examples, fixed code comment typos, etc._).
|
||||||
|
|
||||||
|
|
||||||
## v0.38.0
|
## v0.38.0
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
import{t as e}from"./expandInfo-DGS0CLSa.js";import{t as n}from"./fieldsInfo-Bz62125-.js";function r(e){let n=app.utils.getApiExampleURL(),r=[{title:`OTP request`,content:i},{title:`OTP auth`,content:a}],o=store({activeActionIndex:0});return t.div({pbEvent:`apiPreviewAuthWithOTP`,className:`content`},t.p(null,`Authenticate with an one-time/short-lived password (OTP).`),t.p(null,`Note that when requesting an OTP we return an `,t.code(null,`otpId`),` even if a user with the provided email doesn't exist as a very basic enumeration protection.`),app.components.codeBlockTabs({className:`sdk-examples m-t-sm`,historyKey:`pbLastSDK`,tabs:[{title:`JS SDK`,language:`js`,value:`
|
import{t as e}from"./expandInfo-DGS0CLSa.js";import{t as n}from"./fieldsInfo-Bz62125-.js";function r(e){let n=app.utils.getApiExampleURL(),r=[{title:`OTP request`,content:i},{title:`OTP auth`,content:a}],o=store({activeActionIndex:0});return t.div({pbEvent:`apiPreviewAuthWithOTP`,className:`content`},t.p(null,`Authenticate with an one-time/short-lived password (OTP).`),t.p(null,`On successful authentication the user will be also marked as verified (if the OTP source is email and the user is not verified already).`),t.p(null,`Note that when requesting an OTP we return an `,t.code(null,`otpId`),` even if a user with the provided email doesn't exist as a very basic enumeration protection.`),app.components.codeBlockTabs({className:`sdk-examples m-t-sm`,historyKey:`pbLastSDK`,tabs:[{title:`JS SDK`,language:`js`,value:`
|
||||||
import PocketBase from 'pocketbase';
|
import PocketBase from 'pocketbase';
|
||||||
|
|
||||||
const pb = new PocketBase('${n}');
|
const pb = new PocketBase('${n}');
|
||||||
+8
-3
@@ -1,4 +1,4 @@
|
|||||||
function e(e){let i=app.utils.getApiExampleURL(),a=[{title:`Request email change`,content:n},{title:`Confirm email change`,content:r}],o=store({activeActionIndex:0});return t.div({pbEvent:`apiPreviewEmailChange`,className:`content`},t.p(null,`Sends ${e.name} email change request.`),t.p(null,`On successful email change all previously issued auth tokens for the specific record will be automatically invalidated.`),app.components.codeBlockTabs({className:`sdk-examples m-t-sm`,historyKey:`pbLastSDK`,tabs:[{title:`JS SDK`,language:`js`,value:`
|
function e(e){let i=app.utils.getApiExampleURL(),a=[{title:`Request email change`,content:n},{title:`Confirm email change`,content:r}],o=store({activeActionIndex:0});return t.div({pbEvent:`apiPreviewEmailChange`,className:`content`},t.p(null,`Sends ${e.name} email change request.`),t.p(null,`On successful email change all previously issued auth tokens for the specific record will be invalidated (and the user will be marked as verified if not already).`),app.components.codeBlockTabs({className:`sdk-examples m-t-sm`,historyKey:`pbLastSDK`,tabs:[{title:`JS SDK`,language:`js`,value:`
|
||||||
import PocketBase from 'pocketbase';
|
import PocketBase from 'pocketbase';
|
||||||
|
|
||||||
const pb = new PocketBase('${i}');
|
const pb = new PocketBase('${i}');
|
||||||
@@ -16,7 +16,8 @@ function e(e){let i=app.utils.getApiExampleURL(),a=[{title:`Request email change
|
|||||||
// (optional) in your custom confirmation page:
|
// (optional) in your custom confirmation page:
|
||||||
// ---
|
// ---
|
||||||
|
|
||||||
// note: after this call all previously issued auth tokens are invalidated
|
// note: all previous user auth tokens will be invalidated
|
||||||
|
// (and the user will be marked as verified if not already)
|
||||||
await pb.collection('${e.name}').confirmEmailChange(
|
await pb.collection('${e.name}').confirmEmailChange(
|
||||||
'EMAIL_CHANGE_TOKEN',
|
'EMAIL_CHANGE_TOKEN',
|
||||||
'YOUR_PASSWORD',
|
'YOUR_PASSWORD',
|
||||||
@@ -39,7 +40,8 @@ function e(e){let i=app.utils.getApiExampleURL(),a=[{title:`Request email change
|
|||||||
// (optional) in your custom confirmation page:
|
// (optional) in your custom confirmation page:
|
||||||
// ---
|
// ---
|
||||||
|
|
||||||
// note: after this call all previously issued auth tokens are invalidated
|
// note: all previous user auth tokens will be invalidated
|
||||||
|
// (and the user will be marked as verified if not already)
|
||||||
await pb.collection('${e.name}').confirmEmailChange(
|
await pb.collection('${e.name}').confirmEmailChange(
|
||||||
'EMAIL_CHANGE_TOKEN',
|
'EMAIL_CHANGE_TOKEN',
|
||||||
'YOUR_PASSWORD',
|
'YOUR_PASSWORD',
|
||||||
@@ -53,6 +55,9 @@ function e(e){let i=app.utils.getApiExampleURL(),a=[{title:`Request email change
|
|||||||
'${i}/api/collections/${e.name}/request-email-change'
|
'${i}/api/collections/${e.name}/request-email-change'
|
||||||
|
|
||||||
# Confirm email change
|
# Confirm email change
|
||||||
|
#
|
||||||
|
# note: all previous user auth tokens will be invalidated
|
||||||
|
# (and the user will be marked as verified if not already)
|
||||||
curl -X POST \\
|
curl -X POST \\
|
||||||
-H 'Content-Type:application/json' \\
|
-H 'Content-Type:application/json' \\
|
||||||
-d '{ "token":"...", "password":"" }' \\
|
-d '{ "token":"...", "password":"" }' \\
|
||||||
Vendored
+8
-3
@@ -1,4 +1,4 @@
|
|||||||
function e(e){let i=app.utils.getApiExampleURL(),a=[{title:`Request password reset`,content:n},{title:`Confirm password reset`,content:r}],o=store({activeActionIndex:0});return t.div({pbEvent:`apiPreviewPasswordReset`,className:`content`},t.p(null,`Sends ${e.name} password reset email request.`),t.p(null,`On successful password reset all previously issued auth tokens for the specific record will be automatically invalidated.`),app.components.codeBlockTabs({className:`sdk-examples m-t-sm`,historyKey:`pbLastSDK`,tabs:[{title:`JS SDK`,language:`js`,value:`
|
function e(e){let i=app.utils.getApiExampleURL(),a=[{title:`Request password reset`,content:n},{title:`Confirm password reset`,content:r}],o=store({activeActionIndex:0});return t.div({pbEvent:`apiPreviewPasswordReset`,className:`content`},t.p(null,`Sends ${e.name} password reset email request.`),t.p(null,`On successful password reset all previously issued auth tokens for the specific record will be invalidated (and the user will be marked as verified if not already).`),app.components.codeBlockTabs({className:`sdk-examples m-t-sm`,historyKey:`pbLastSDK`,tabs:[{title:`JS SDK`,language:`js`,value:`
|
||||||
import PocketBase from 'pocketbase';
|
import PocketBase from 'pocketbase';
|
||||||
|
|
||||||
const pb = new PocketBase('${i}');
|
const pb = new PocketBase('${i}');
|
||||||
@@ -11,7 +11,8 @@ function e(e){let i=app.utils.getApiExampleURL(),a=[{title:`Request password res
|
|||||||
// (optional) in your custom confirmation page:
|
// (optional) in your custom confirmation page:
|
||||||
// ---
|
// ---
|
||||||
|
|
||||||
// note: after this call all previously issued auth tokens are invalidated
|
// note: all previous user auth tokens will be invalidated
|
||||||
|
// (and the user will be marked as verified if not already)
|
||||||
await pb.collection('${e.name}').confirmPasswordReset(
|
await pb.collection('${e.name}').confirmPasswordReset(
|
||||||
'RESET_TOKEN',
|
'RESET_TOKEN',
|
||||||
'NEW_PASSWORD',
|
'NEW_PASSWORD',
|
||||||
@@ -30,7 +31,8 @@ function e(e){let i=app.utils.getApiExampleURL(),a=[{title:`Request password res
|
|||||||
// (optional) in your custom confirmation page:
|
// (optional) in your custom confirmation page:
|
||||||
// ---
|
// ---
|
||||||
|
|
||||||
// note: after this call all previously issued auth tokens are invalidated
|
// note: all previous user auth tokens will be invalidated
|
||||||
|
// (and the user will be marked as verified if not already)
|
||||||
await pb.collection('${e.name}').confirmPasswordReset(
|
await pb.collection('${e.name}').confirmPasswordReset(
|
||||||
'RESET_TOKEN',
|
'RESET_TOKEN',
|
||||||
'NEW_PASSWORD',
|
'NEW_PASSWORD',
|
||||||
@@ -44,6 +46,9 @@ function e(e){let i=app.utils.getApiExampleURL(),a=[{title:`Request password res
|
|||||||
'${i}/api/collections/${e.name}/request-password-reset'
|
'${i}/api/collections/${e.name}/request-password-reset'
|
||||||
|
|
||||||
# Confirm password reset
|
# Confirm password reset
|
||||||
|
#
|
||||||
|
# note: all previous user auth tokens will be invalidated
|
||||||
|
# (and the user will be marked as verified if not already)
|
||||||
curl -X POST \\
|
curl -X POST \\
|
||||||
-H 'Content-Type:application/json' \\
|
-H 'Content-Type:application/json' \\
|
||||||
-d '{ "token":"...", "password":"", "passwordConfirm":"" }' \\
|
-d '{ "token":"...", "password":"", "passwordConfirm":"" }' \\
|
||||||
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
<!-- prism -->
|
<!-- prism -->
|
||||||
<script src="./libs/prism/prism.js" data-manual></script>
|
<script src="./libs/prism/prism.js" data-manual></script>
|
||||||
<script type="module" crossorigin src="./assets/index-Dko-neZT.js"></script>
|
<script type="module" crossorigin src="./assets/index-CphO81V5.js"></script>
|
||||||
<link rel="modulepreload" crossorigin href="./assets/pocketbase.es-B_4DUNUU.js">
|
<link rel="modulepreload" crossorigin href="./assets/pocketbase.es-B_4DUNUU.js">
|
||||||
<link rel="stylesheet" crossorigin href="./assets/index-DRWtZ-mO.css">
|
<link rel="stylesheet" crossorigin href="./assets/index-DRWtZ-mO.css">
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -20,6 +20,10 @@ export function docsAuthWithOTP(collection) {
|
|||||||
},
|
},
|
||||||
// description
|
// description
|
||||||
t.p(null, "Authenticate with an one-time/short-lived password (OTP)."),
|
t.p(null, "Authenticate with an one-time/short-lived password (OTP)."),
|
||||||
|
t.p(
|
||||||
|
null,
|
||||||
|
"On successful authentication the user will be also marked as verified (if the OTP source is email and the user is not verified already).",
|
||||||
|
),
|
||||||
t.p(
|
t.p(
|
||||||
null,
|
null,
|
||||||
"Note that when requesting an OTP we return an ",
|
"Note that when requesting an OTP we return an ",
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export function docsEmailChange(collection) {
|
|||||||
t.p(null, `Sends ${collection.name} email change request.`),
|
t.p(null, `Sends ${collection.name} email change request.`),
|
||||||
t.p(
|
t.p(
|
||||||
null,
|
null,
|
||||||
"On successful email change all previously issued auth tokens for the specific record will be automatically invalidated.",
|
"On successful email change all previously issued auth tokens for the specific record will be invalidated (and the user will be marked as verified if not already).",
|
||||||
),
|
),
|
||||||
app.components.codeBlockTabs({
|
app.components.codeBlockTabs({
|
||||||
className: "sdk-examples m-t-sm",
|
className: "sdk-examples m-t-sm",
|
||||||
@@ -46,7 +46,8 @@ export function docsEmailChange(collection) {
|
|||||||
// (optional) in your custom confirmation page:
|
// (optional) in your custom confirmation page:
|
||||||
// ---
|
// ---
|
||||||
|
|
||||||
// note: after this call all previously issued auth tokens are invalidated
|
// note: all previous user auth tokens will be invalidated
|
||||||
|
// (and the user will be marked as verified if not already)
|
||||||
await pb.collection('${collection.name}').confirmEmailChange(
|
await pb.collection('${collection.name}').confirmEmailChange(
|
||||||
'EMAIL_CHANGE_TOKEN',
|
'EMAIL_CHANGE_TOKEN',
|
||||||
'YOUR_PASSWORD',
|
'YOUR_PASSWORD',
|
||||||
@@ -83,7 +84,8 @@ export function docsEmailChange(collection) {
|
|||||||
// (optional) in your custom confirmation page:
|
// (optional) in your custom confirmation page:
|
||||||
// ---
|
// ---
|
||||||
|
|
||||||
// note: after this call all previously issued auth tokens are invalidated
|
// note: all previous user auth tokens will be invalidated
|
||||||
|
// (and the user will be marked as verified if not already)
|
||||||
await pb.collection('${collection.name}').confirmEmailChange(
|
await pb.collection('${collection.name}').confirmEmailChange(
|
||||||
'EMAIL_CHANGE_TOKEN',
|
'EMAIL_CHANGE_TOKEN',
|
||||||
'YOUR_PASSWORD',
|
'YOUR_PASSWORD',
|
||||||
@@ -111,6 +113,9 @@ export function docsEmailChange(collection) {
|
|||||||
'${baseURL}/api/collections/${collection.name}/request-email-change'
|
'${baseURL}/api/collections/${collection.name}/request-email-change'
|
||||||
|
|
||||||
# Confirm email change
|
# Confirm email change
|
||||||
|
#
|
||||||
|
# note: all previous user auth tokens will be invalidated
|
||||||
|
# (and the user will be marked as verified if not already)
|
||||||
curl -X POST \\
|
curl -X POST \\
|
||||||
-H 'Content-Type:application/json' \\
|
-H 'Content-Type:application/json' \\
|
||||||
-d '{ "token":"...", "password":"" }' \\
|
-d '{ "token":"...", "password":"" }' \\
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export function docsPasswordReset(collection) {
|
|||||||
t.p(null, `Sends ${collection.name} password reset email request.`),
|
t.p(null, `Sends ${collection.name} password reset email request.`),
|
||||||
t.p(
|
t.p(
|
||||||
null,
|
null,
|
||||||
"On successful password reset all previously issued auth tokens for the specific record will be automatically invalidated.",
|
"On successful password reset all previously issued auth tokens for the specific record will be invalidated (and the user will be marked as verified if not already).",
|
||||||
),
|
),
|
||||||
app.components.codeBlockTabs({
|
app.components.codeBlockTabs({
|
||||||
className: "sdk-examples m-t-sm",
|
className: "sdk-examples m-t-sm",
|
||||||
@@ -41,7 +41,8 @@ export function docsPasswordReset(collection) {
|
|||||||
// (optional) in your custom confirmation page:
|
// (optional) in your custom confirmation page:
|
||||||
// ---
|
// ---
|
||||||
|
|
||||||
// note: after this call all previously issued auth tokens are invalidated
|
// note: all previous user auth tokens will be invalidated
|
||||||
|
// (and the user will be marked as verified if not already)
|
||||||
await pb.collection('${collection.name}').confirmPasswordReset(
|
await pb.collection('${collection.name}').confirmPasswordReset(
|
||||||
'RESET_TOKEN',
|
'RESET_TOKEN',
|
||||||
'NEW_PASSWORD',
|
'NEW_PASSWORD',
|
||||||
@@ -74,7 +75,8 @@ export function docsPasswordReset(collection) {
|
|||||||
// (optional) in your custom confirmation page:
|
// (optional) in your custom confirmation page:
|
||||||
// ---
|
// ---
|
||||||
|
|
||||||
// note: after this call all previously issued auth tokens are invalidated
|
// note: all previous user auth tokens will be invalidated
|
||||||
|
// (and the user will be marked as verified if not already)
|
||||||
await pb.collection('${collection.name}').confirmPasswordReset(
|
await pb.collection('${collection.name}').confirmPasswordReset(
|
||||||
'RESET_TOKEN',
|
'RESET_TOKEN',
|
||||||
'NEW_PASSWORD',
|
'NEW_PASSWORD',
|
||||||
@@ -102,6 +104,9 @@ export function docsPasswordReset(collection) {
|
|||||||
'${baseURL}/api/collections/${collection.name}/request-password-reset'
|
'${baseURL}/api/collections/${collection.name}/request-password-reset'
|
||||||
|
|
||||||
# Confirm password reset
|
# Confirm password reset
|
||||||
|
#
|
||||||
|
# note: all previous user auth tokens will be invalidated
|
||||||
|
# (and the user will be marked as verified if not already)
|
||||||
curl -X POST \\
|
curl -X POST \\
|
||||||
-H 'Content-Type:application/json' \\
|
-H 'Content-Type:application/json' \\
|
||||||
-d '{ "token":"...", "password":"", "passwordConfirm":"" }' \\
|
-d '{ "token":"...", "password":"", "passwordConfirm":"" }' \\
|
||||||
|
|||||||
Reference in New Issue
Block a user