|
|
@ -7,7 +7,9 @@ import handleAPIError from '../lib/handleAPIError'; |
|
|
|
import { Panel } from './Panels'; |
|
|
|
import { Panel } from './Panels'; |
|
|
|
|
|
|
|
|
|
|
|
const GatePanel: FC = () => { |
|
|
|
const GatePanel: FC = () => { |
|
|
|
const router = useRouter(); |
|
|
|
const { |
|
|
|
|
|
|
|
query: { rt: returnTo }, |
|
|
|
|
|
|
|
} = useRouter(); |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<Panel |
|
|
|
<Panel |
|
|
@ -32,7 +34,9 @@ const GatePanel: FC = () => { |
|
|
|
{ withCredentials: true }, |
|
|
|
{ withCredentials: true }, |
|
|
|
) |
|
|
|
) |
|
|
|
.then(() => { |
|
|
|
.then(() => { |
|
|
|
router.push('/'); |
|
|
|
const url = returnTo ? String(returnTo) : '/'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
window.location.replace(url); |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch((error) => { |
|
|
|
.catch((error) => { |
|
|
|
const emsg = handleAPIError(error, { |
|
|
|
const emsg = handleAPIError(error, { |
|
|
|