keep-around/1d06f55c2b729e25cd8684a146a86df6860d2876
parent
9f218b345a
commit
04609ac480
@ -0,0 +1,31 @@ |
||||
import { useLocation } from 'react-router' |
||||
|
||||
import { getClientSettings } from 'features/AuthStore/helpers' |
||||
import { useLexicsStore } from 'features/LexicsStore' |
||||
|
||||
export const useParamsUrl = () => { |
||||
const location = useLocation() |
||||
const { lang } = useLexicsStore() |
||||
|
||||
const { |
||||
client_id, |
||||
redirect_uri, |
||||
response_mode, |
||||
response_type, |
||||
scope, |
||||
} = getClientSettings() |
||||
|
||||
const urlSearchParams = new URLSearchParams(location.search) |
||||
|
||||
const params = Object.fromEntries(urlSearchParams.entries()) |
||||
|
||||
return { |
||||
client_id, |
||||
redirect_uri, |
||||
response_mode, |
||||
response_type, |
||||
scope, |
||||
...params, |
||||
lang, |
||||
} |
||||
} |
||||
Loading…
Reference in new issue