Skip to content

Commit 99eb5e3

Browse files
committed
fix(docs): use object destructuring for decorateUrl in navigate callbacks
The navigate callback receives an object { session, decorateUrl }, not decorateUrl directly. Without destructuring, decorateUrl('/') would throw at runtime.
1 parent a9f781e commit 99eb5e3

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

docs/guides/development/custom-flows/authentication/application-invitations.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ To create a sign-up flow using the invitation token, you need to call the [`sign
6060
})
6161
if (signUp.status === 'complete') {
6262
await signUp.finalize({
63-
navigate: (decorateUrl) => {
63+
navigate: ({ decorateUrl }) => {
6464
const url = decorateUrl('/')
6565
if (url.startsWith('http')) {
6666
window.location.href = url

docs/guides/development/custom-flows/authentication/email-password-mfa.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ This guide will walk you through how to build a custom email/password sign-in fl
8282
})
8383
if (signIn.status === 'complete') {
8484
await signIn.finalize({
85-
navigate: (decorateUrl) => {
85+
navigate: ({ decorateUrl }) => {
8686
const url = decorateUrl('/')
8787
if (url.startsWith('http')) {
8888
window.location.href = url
@@ -106,7 +106,7 @@ This guide will walk you through how to build a custom email/password sign-in fl
106106

107107
if (signIn.status === 'complete') {
108108
await signIn.finalize({
109-
navigate: (decorateUrl) => {
109+
navigate: ({ decorateUrl }) => {
110110
const url = decorateUrl('/')
111111
if (url.startsWith('http')) {
112112
window.location.href = url
@@ -214,7 +214,7 @@ This guide will walk you through how to build a custom email/password sign-in fl
214214

215215
if (signIn.status === 'complete') {
216216
await signIn.finalize({
217-
navigate: (decorateUrl) => {
217+
navigate: ({ decorateUrl }) => {
218218
const url = decorateUrl('/')
219219
if (url.startsWith('http')) {
220220
window.location.href = url

docs/guides/development/custom-flows/authentication/email-password.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ This guide will walk you through how to build a custom email/password sign-up an
7676
})
7777
if (signUp.status === 'complete') {
7878
await signUp.finalize({
79-
navigate: (decorateUrl) => {
79+
navigate: ({ decorateUrl }) => {
8080
const url = decorateUrl('/dashboard')
8181
if (url.startsWith('http')) {
8282
window.location.href = url
@@ -400,7 +400,7 @@ This guide will walk you through how to build a custom email/password sign-up an
400400
})
401401
if (signIn.status === 'complete') {
402402
await signIn.finalize({
403-
navigate: (decorateUrl) => {
403+
navigate: ({ decorateUrl }) => {
404404
const url = decorateUrl('/')
405405
if (url.startsWith('http')) {
406406
window.location.href = url
@@ -424,7 +424,7 @@ This guide will walk you through how to build a custom email/password sign-up an
424424

425425
if (signIn.status === 'complete') {
426426
await signIn.finalize({
427-
navigate: (decorateUrl) => {
427+
navigate: ({ decorateUrl }) => {
428428
const url = decorateUrl('/')
429429
if (url.startsWith('http')) {
430430
window.location.href = url

docs/guides/development/custom-flows/authentication/email-sms-otp.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ This guide will walk you through how to build a custom SMS OTP sign-up and sign-
7171
await signUp.verifications.verifyPhoneCode({ code })
7272
if (signUp.status === 'complete') {
7373
await signUp.finalize({
74-
navigate: (decorateUrl) => {
74+
navigate: ({ decorateUrl }) => {
7575
const url = decorateUrl('/dashboard')
7676
if (url.startsWith('http')) {
7777
window.location.href = url
@@ -393,7 +393,7 @@ This guide will walk you through how to build a custom SMS OTP sign-up and sign-
393393
await signIn.phoneCode.verifyCode({ code })
394394
if (signIn.status === 'complete') {
395395
await signIn.finalize({
396-
navigate: (decorateUrl) => {
396+
navigate: ({ decorateUrl }) => {
397397
const url = decorateUrl('/')
398398
if (url.startsWith('http')) {
399399
window.location.href = url

0 commit comments

Comments
 (0)