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

Loading…
Cancel
Save