[web] auth/error: don't return to current page for error screens
This commit is contained in:
parent
bddfee6fbc
commit
a1eec4e02c
|
|
@ -17,7 +17,7 @@ type Props = Readonly<{
|
|||
export default function AuthLoginError({ code, description }: Props) {
|
||||
const errorContent = useErrorMessages();
|
||||
const intl = useIntl();
|
||||
const { signInUpHref } = useAuthSignInUp();
|
||||
const { signInUpHref } = useAuthSignInUp(false);
|
||||
|
||||
const { message: errorMessage, name: errorName } =
|
||||
errorContent[code ?? ''] || {};
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ type AuthHrefProps = Readonly<{
|
|||
query?: ParsedUrlQueryInput;
|
||||
}>;
|
||||
|
||||
export function useAuthSignInUp() {
|
||||
export function useAuthSignInUp(returnToCurrentPage = true) {
|
||||
const [signedInBefore] = useAuthSignedInBefore();
|
||||
const intl = useIntl();
|
||||
const router = useI18nRouter();
|
||||
|
|
@ -40,7 +40,7 @@ export function useAuthSignInUp() {
|
|||
return url.format({
|
||||
pathname: signedInBefore ? '/login' : '/sign-up',
|
||||
query: {
|
||||
...(finalNext ? { next: finalNext } : {}),
|
||||
...(returnToCurrentPage && finalNext ? { next: finalNext } : {}),
|
||||
...query,
|
||||
},
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue