updated API preview examples
This commit is contained in:
@@ -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');
|
||||
`}
|
||||
/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user