mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
fix(console): input verification code in profile page should not crash the app (#4489)
* fix(console): input verification code in profile page should not crash the app * chore: add changeset
This commit is contained in:
parent
fa8ac7761d
commit
18e05586cc
2 changed files with 8 additions and 1 deletions
5
.changeset/mean-jeans-clap.md
Normal file
5
.changeset/mean-jeans-clap.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"@logto/console": patch
|
||||
---
|
||||
|
||||
fix the app crash when inputting verification code in Console profile page
|
|
@ -1,5 +1,6 @@
|
|||
import { ossConsolePath } from '@logto/schemas';
|
||||
import { conditionalArray, joinPath } from '@silverhand/essentials';
|
||||
import { useMemo } from 'react';
|
||||
import { useHref } from 'react-router-dom';
|
||||
|
||||
import { isCloud } from '@/consts/env';
|
||||
|
@ -13,8 +14,9 @@ const useRedirectUri = (flow: 'signIn' | 'signOut' = 'signIn') => {
|
|||
const path = useHref(
|
||||
joinPath(...conditionalArray(!isCloud && ossConsolePath, flow === 'signIn' ? '/callback' : '/'))
|
||||
);
|
||||
const url = useMemo(() => new URL(path, window.location.origin), [path]);
|
||||
|
||||
return new URL(path, window.location.origin);
|
||||
return url;
|
||||
};
|
||||
|
||||
export default useRedirectUri;
|
||||
|
|
Loading…
Reference in a new issue