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