authelia/web/src/hooks/RedirectionURL.ts

10 lines
327 B
TypeScript
Raw Normal View History

import queryString from "query-string";
import { useLocation } from "react-router";
export function useRedirectionURL() {
const location = useLocation();
const queryParams = queryString.parse(location.search);
return (queryParams && "rd" in queryParams)
? queryParams["rd"] as string
: undefined;
}