0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-06 20:40:08 -05:00

fix(ui): added search + hash string interpolation (#3431)

Signed-off-by: Tasos Derisiotis <50984242+Eengineer1@users.noreply.github.com>
This commit is contained in:
Tasos Derisiotis 2023-03-15 16:41:03 +02:00 committed by GitHub
parent 451f77161e
commit 382c8a82a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,8 +8,16 @@ const useSocialCallbackHandler = () => {
const socialCallbackHandler = useCallback(
(connectorId: string) => {
// Apple use fragment mode to store auth parameter. Need to support it.
const search = window.location.search || '?' + window.location.hash.slice(1);
// Get search string to evaluate
const searchString = window.location.search;
// Get hash string to evaluate
const hashString = window.location.hash;
// Define evaluated search string
const search = `${searchString || '?'}${
searchString && hashString ? '&' : ''
}${hashString.slice(1)}`;
// Get native callback link from storage
const callbackLink = getCallbackLinkFromStorage(connectorId);