fix(striker-ui): use query param return-to in login

main
Tsu-ba-me 2 years ago
parent 9337b3c881
commit 0b304251ff
  1. 8
      striker-ui/components/GatePanel.tsx

@ -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, {

Loading…
Cancel
Save