Skip to content

Commit

Permalink
feat: refactor redirect flow of settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Nelfimov committed Dec 26, 2023
1 parent 0f1129a commit c8d517d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/identity-integration/src/flows/settings.flow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,13 @@ export const SettingsFlow: FC<PropsWithChildren<SettingsFlowProps>> = ({
)
.then(({ data }) => {
setFlow(data)
router.push('/')
if (flow?.return_to) {
window.location.href = flow?.return_to
} else if (returnToUrl) {
router.push(returnToUrl)
} else {
router.replace(router.asPath)
}
})
.catch(handleFlowError(router, 'settings', setFlow, returnToSettingsUrl))
.catch((error: AxiosError<KratosSettingsFlow>) => {
Expand Down

0 comments on commit c8d517d

Please sign in to comment.