redirect
This commit is contained in:
@@ -39,7 +39,7 @@ const CreateReview: FC<Props> = ({ refetch, id }) => {
|
|||||||
},
|
},
|
||||||
onError: (error: ErrorType) => {
|
onError: (error: ErrorType) => {
|
||||||
if (error.response && 'status' in error.response && error.response.status === 401) {
|
if (error.response && 'status' in error.response && error.response.status === 401) {
|
||||||
window.location.href = LOGIN_URL + '?redirect=' + window.location.href
|
window.location.href = LOGIN_URL
|
||||||
} else {
|
} else {
|
||||||
toast(error.response?.data?.error?.message?.[0] || 'An error occurred', 'error')
|
toast(error.response?.data?.error?.message?.[0] || 'An error occurred', 'error')
|
||||||
}
|
}
|
||||||
@@ -64,7 +64,7 @@ const CreateReview: FC<Props> = ({ refetch, id }) => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='mt-6 flex justify-center'>
|
<div className='mt-6 flex justify-center'>
|
||||||
<Link href={LOGIN_URL + '?redirect=' + window.location.href}>
|
<Link href={LOGIN_URL}>
|
||||||
<Button
|
<Button
|
||||||
label={'ورود | ثبت نام'}
|
label={'ورود | ثبت نام'}
|
||||||
className='w-fit px-7'
|
className='w-fit px-7'
|
||||||
|
|||||||
@@ -79,8 +79,8 @@ const Header: FC = () => {
|
|||||||
|
|
||||||
{typeof window !== 'undefined' && (
|
{typeof window !== 'undefined' && (
|
||||||
(() => {
|
(() => {
|
||||||
const currentUrl = window.location.href
|
// const currentUrl = window.location.href
|
||||||
const profileLink = isLogin ? `${CONSOLE_URL}/dashboard` : `${LOGIN_URL}?redirect=${encodeURIComponent(currentUrl)}`
|
const profileLink = isLogin ? `${CONSOLE_URL}/dashboard` : `${LOGIN_URL}`
|
||||||
return (
|
return (
|
||||||
<a href={profileLink} target='_blank' className='border-l-2 whitespace-nowrap border-[#D8DCE4] pl-4 flex gap-2'>
|
<a href={profileLink} target='_blank' className='border-l-2 whitespace-nowrap border-[#D8DCE4] pl-4 flex gap-2'>
|
||||||
<Profile
|
<Profile
|
||||||
@@ -129,8 +129,8 @@ const Header: FC = () => {
|
|||||||
|
|
||||||
{typeof window !== 'undefined' && (
|
{typeof window !== 'undefined' && (
|
||||||
(() => {
|
(() => {
|
||||||
const currentUrl = window.location.href
|
// const currentUrl = window.location.href
|
||||||
const profileLink = isLogin ? `${CONSOLE_URL}/dashboard` : `${LOGIN_URL}?redirect=${encodeURIComponent(currentUrl)}`
|
const profileLink = isLogin ? `${CONSOLE_URL}/dashboard` : `${LOGIN_URL}`
|
||||||
return (
|
return (
|
||||||
<a href={profileLink} target='_blank'>
|
<a href={profileLink} target='_blank'>
|
||||||
<Profile
|
<Profile
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ const SideBar: FC = () => {
|
|||||||
if (!isLogin)
|
if (!isLogin)
|
||||||
return (
|
return (
|
||||||
<div className='flex-1 flex items-end justify-center px-12'>
|
<div className='flex-1 flex items-end justify-center px-12'>
|
||||||
<Link className='w-full' href={`${LOGIN_URL}?redirect=${encodeURIComponent(window.location.href)}`}>
|
<Link className='w-full' href={`${LOGIN_URL}`}>
|
||||||
<Button
|
<Button
|
||||||
label='ورود | ثبت نام'
|
label='ورود | ثبت نام'
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user