Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/_partials/expo/email-pass-sign-in.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ export default function Page() {

if (signIn.status === 'complete') {
await signIn.finalize({
navigate: () => {
router.push('/')
navigate: ({ decorateUrl }) => {
router.push(decorateUrl('/'))
},
})
}
Expand All @@ -44,8 +44,8 @@ export default function Page() {

if (signIn.status === 'complete') {
await signIn.finalize({
navigate: () => {
router.push('/')
navigate: ({ decorateUrl }) => {
router.push(decorateUrl('/'))
},
})
}
Expand Down
4 changes: 2 additions & 2 deletions docs/_partials/expo/email-pass-sign-up.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ export default function Page() {

if (signUp.status === 'complete') {
await signUp.finalize({
navigate: () => {
router.push('/')
navigate: ({ decorateUrl }) => {
router.push(decorateUrl('/'))
},
})
}
Expand Down
7 changes: 0 additions & 7 deletions docs/getting-started/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@ llm:
link: "https://github.com/clerk/clerk-nextjs-app-quickstart"
}
]}
beforeYouStart={[
{
title: "Set up a Clerk application",
link: "/docs/getting-started/quickstart/setup-clerk",
icon: "clerk",
},
]}
/>

<Steps>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,20 @@ This guide demonstrates how to use Clerk's API to build a custom flow for resett
// the newly created session (user is now signed in)
setActive({
session: result.createdSessionId,
navigate: async ({ session }) => {
navigate: async ({ session, decorateUrl }) => {
if (session?.currentTask) {
// Check for tasks and navigate to custom UI to help users resolve them
// See https://clerk.com/docs/guides/development/custom-flows/authentication/session-tasks
console.log(session?.currentTask)
return
}

router.push('/')
const url = decorateUrl('/')
if (url.startsWith('http')) {
window.location.href = url
} else {
router.push(url)
}
},
})
setError('')
Expand Down Expand Up @@ -502,15 +507,20 @@ In this case, you can prompt the user to reset their password using the exact sa
// the newly created session (user is now signed in)
setActive({
session: result.createdSessionId,
navigate: async ({ session }) => {
navigate: async ({ session, decorateUrl }) => {
if (session?.currentTask) {
// Check for tasks and navigate to custom UI to help users resolve them
// See https://clerk.com/docs/guides/development/custom-flows/authentication/session-tasks
console.log(session?.currentTask)
return
}

router.push('/')
const url = decorateUrl('/')
if (url.startsWith('http')) {
window.location.href = url
} else {
router.push(url)
}
},
})
setError('')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,13 @@ To create a sign-up flow using the invitation token, you need to call the [`sign
})
if (signUp.status === 'complete') {
await signUp.finalize({
navigate: () => {
router.push('/')
navigate: ({ decorateUrl }) => {
const url = decorateUrl('/')
if (url.startsWith('http')) {
window.location.href = url
} else {
router.push(url)
}
},
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,13 @@ This guide will walk you through how to build a custom email/password sign-in fl
})
if (signIn.status === 'complete') {
await signIn.finalize({
navigate: () => {
router.push('/')
navigate: ({ decorateUrl }) => {
const url = decorateUrl('/')
if (url.startsWith('http')) {
window.location.href = url
} else {
router.push(url)
}
},
})
}
Expand All @@ -101,8 +106,13 @@ This guide will walk you through how to build a custom email/password sign-in fl

if (signIn.status === 'complete') {
await signIn.finalize({
navigate: () => {
router.push('/')
navigate: ({ decorateUrl }) => {
const url = decorateUrl('/')
if (url.startsWith('http')) {
window.location.href = url
} else {
router.push(url)
}
},
})
}
Expand Down Expand Up @@ -204,8 +214,13 @@ This guide will walk you through how to build a custom email/password sign-in fl

if (signIn.status === 'complete') {
await signIn.finalize({
navigate: () => {
router.push('/')
navigate: ({ decorateUrl }) => {
const url = decorateUrl('/')
if (url.startsWith('http')) {
window.location.href = url
} else {
router.push(url)
}
},
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,13 @@ This guide will walk you through how to build a custom email/password sign-up an
})
if (signUp.status === 'complete') {
await signUp.finalize({
navigate: () => {
router.push('/dashboard')
navigate: ({ decorateUrl }) => {
const url = decorateUrl('/dashboard')
if (url.startsWith('http')) {
window.location.href = url
} else {
router.push(url)
}
},
})
}
Expand Down Expand Up @@ -395,8 +400,13 @@ This guide will walk you through how to build a custom email/password sign-up an
})
if (signIn.status === 'complete') {
await signIn.finalize({
navigate: () => {
router.push('/')
navigate: ({ decorateUrl }) => {
const url = decorateUrl('/')
if (url.startsWith('http')) {
window.location.href = url
} else {
router.push(url)
}
},
})
}
Expand All @@ -414,8 +424,13 @@ This guide will walk you through how to build a custom email/password sign-up an

if (signIn.status === 'complete') {
await signIn.finalize({
navigate: () => {
router.push('/')
navigate: ({ decorateUrl }) => {
const url = decorateUrl('/')
if (url.startsWith('http')) {
window.location.href = url
} else {
router.push(url)
}
},
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,13 @@ This guide will walk you through how to build a custom SMS OTP sign-up and sign-
await signUp.verifications.verifyPhoneCode({ code })
if (signUp.status === 'complete') {
await signUp.finalize({
navigate: () => {
router.push('/dashboard')
navigate: ({ decorateUrl }) => {
const url = decorateUrl('/dashboard')
if (url.startsWith('http')) {
window.location.href = url
} else {
router.push(url)
}
},
})
}
Expand Down Expand Up @@ -388,8 +393,13 @@ This guide will walk you through how to build a custom SMS OTP sign-up and sign-
await signIn.phoneCode.verifyCode({ code })
if (signIn.status === 'complete') {
await signIn.finalize({
navigate: () => {
router.push('/')
navigate: ({ decorateUrl }) => {
const url = decorateUrl('/')
if (url.startsWith('http')) {
window.location.href = url
} else {
router.push(url)
}
},
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,18 @@ This guide will demonstrate how to generate a sign-in token and use it to sign i
// If the sign-in was successful, set the session to active
if (signIn.status === 'complete') {
signIn.finalize({
navigate: async ({ session }) => {
navigate: async ({ session, decorateUrl }) => {
if (session?.currentTask) {
console.log(session?.currentTask)
return
}

router.push('/')
const url = decorateUrl('/')
if (url.startsWith('http')) {
window.location.href = url
} else {
router.push(url)
}
},
})
} else {
Expand Down Expand Up @@ -170,13 +175,18 @@ This guide will demonstrate how to generate a sign-in token and use it to sign i
// If the sign-in was successful, set the session to active
if (signIn.status === 'complete') {
signIn.finalize({
navigate: async ({ session }) => {
navigate: async ({ session, decorateUrl }) => {
if (session?.currentTask) {
console.log(session?.currentTask)
return
}

router.push('/')
const url = decorateUrl('/')
if (url.startsWith('http')) {
window.location.href = url
} else {
router.push(url)
}
},
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,20 @@ You must configure your application instance through the Clerk Dashboard for the
if (createdSessionId) {
setActive!({
session: createdSessionId,
navigate: async ({ session }) => {
navigate: async ({ session, decorateUrl }) => {
if (session?.currentTask) {
// Check for tasks and navigate to custom UI to help users resolve them
// See https://clerk.com/docs/guides/development/custom-flows/authentication/session-tasks
console.log(session?.currentTask)
return
}

router.push('/')
const url = decorateUrl('/')
if (url.startsWith('http')) {
window.location.href = url
} else {
router.push(url)
}
},
})
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,15 +228,20 @@ To create a sign-up flow using the invitation token, you need to extract the tok
if (signUpAttempt.status === 'complete') {
await clerk.setActive({
session: signUpAttempt.createdSessionId,
navigate: async ({ session }) => {
navigate: async ({ session, decorateUrl }) => {
if (session?.currentTask) {
// Check for tasks and navigate to custom UI to help users resolve them
// See https://clerk.com/docs/guides/development/custom-flows/authentication/session-tasks
console.log(session?.currentTask)
return
}

await router.push('/')
const url = decorateUrl('/')
if (url.startsWith('http')) {
window.location.href = url
} else {
window.location.href = url
}
},
})
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,20 @@ This guide will walk you through how to build a custom email/password sign-in fl
if (signInAttempt.status === 'complete') {
await setActive({
session: signInAttempt.createdSessionId,
navigate: async ({ session }) => {
navigate: async ({ session, decorateUrl }) => {
if (session?.currentTask) {
// Check for tasks and navigate to custom UI to help users resolve them
// See https://clerk.com/docs/guides/development/custom-flows/authentication/session-tasks
console.log(session?.currentTask)
return
}

await router.push('/')
const url = decorateUrl('/')
if (url.startsWith('http')) {
window.location.href = url
} else {
router.push(url)
}
},
})
} else {
Expand Down Expand Up @@ -386,15 +391,20 @@ This guide will walk you through how to build a custom email/password sign-in fl
if (attemptFirstFactor.status === 'complete') {
await setActive({
session: attemptFirstFactor.createdSessionId,
navigate: async ({ session }) => {
navigate: async ({ session, decorateUrl }) => {
if (session?.currentTask) {
// Check for tasks and navigate to custom UI to help users resolve them
// See https://clerk.com/docs/guides/development/custom-flows/authentication/session-tasks
console.log(session?.currentTask)
return
}

await router.push('/')
const url = decorateUrl('/')
if (url.startsWith('http')) {
window.location.href = url
} else {
router.push(url)
}
},
})
} else if (attemptFirstFactor.status === 'needs_second_factor') {
Expand Down Expand Up @@ -428,15 +438,20 @@ This guide will walk you through how to build a custom email/password sign-in fl
if (attemptSecondFactor.status === 'complete') {
await setActive({
session: attemptSecondFactor.createdSessionId,
navigate: async ({ session }) => {
navigate: async ({ session, decorateUrl }) => {
if (session?.currentTask) {
// Check for tasks and navigate to custom UI to help users resolve them
// See https://clerk.com/docs/guides/development/custom-flows/authentication/session-tasks
console.log(session?.currentTask)
return
}

await router.push('/')
const url = decorateUrl('/')
if (url.startsWith('http')) {
window.location.href = url
} else {
router.push(url)
}
},
})
} else {
Expand Down
Loading