updated API preview examples

This commit is contained in:
Gani Georgiev
2023-11-26 14:59:14 +02:00
parent 531a7abec9
commit 3f2e38ca82
35 changed files with 195 additions and 152 deletions
@@ -37,6 +37,10 @@
<h3 class="m-b-sm">Confirm email change ({collection.name})</h3>
<div class="content txt-lg m-b-sm">
<p>Confirms <strong>{collection.name}</strong> email change request.</p>
<p>
After this request all previously issued tokens for the specific record will be automatically
invalidated.
</p>
</div>
<SdkTabs
@@ -51,11 +51,17 @@
...
let oldAuth = await pb.authStore.model;
await pb.collection('${collection?.name}').confirmPasswordReset(
'TOKEN',
'NEW_PASSWORD',
'NEW_PASSWORD_CONFIRM',
);
// reauthenticate if needed
// (after the above call all previously issued tokens are invalidated)
await pb.collection('${collection?.name}').authWithPassword(oldAuth.email, 'NEW_PASSWORD');
`}
dart={`
import 'package:pocketbase/pocketbase.dart';
@@ -64,11 +70,17 @@
...
final oldAuth = await pb.authStore.model;
await pb.collection('${collection?.name}').confirmPasswordReset(
'TOKEN',
'NEW_PASSWORD',
'NEW_PASSWORD_CONFIRM',
);
// reauthenticate if needed
// (after the above call all previously issued tokens are invalidated)
await pb.collection('${collection?.name}').authWithPassword(oldAuth.email, 'NEW_PASSWORD');
`}
/>