0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-27 21:39:16 -05:00

fix(ui): fix callback link params for apple (#985)

fix callback link params for apple
This commit is contained in:
simeng-li 2022-05-30 11:56:23 +08:00 committed by GitHub
parent d0d507ab79
commit 362c3a6e6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,6 +14,7 @@ const useSocialCallbackHandler = () => {
const socialCallbackHandler = useCallback(
(connectorId: string) => {
// Apple use fragment mode to store auth parameter. Need to support it.
const data = window.location.search || '?' + window.location.hash.slice(1);
const { state, error, error_description } = parseQueryParameters(data);
@ -35,7 +36,7 @@ const useSocialCallbackHandler = () => {
const callbackLink = getCallbackLinkFromStorage(connectorId);
if (callbackLink) {
window.location.replace(new URL(`${callbackLink}${window.location.search}`));
window.location.replace(new URL(`${callbackLink}${data}`));
return;
}