File tree Expand file tree Collapse file tree
packages/ui/src/contexts/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ ' @clerk/ui ' : patch
3+ ---
4+
5+ Fix Safari sign-in redirect not completing when using OTP or impersonation.
Original file line number Diff line number Diff line change 11import { buildTaskUrl , getTaskEndpoint } from '@clerk/shared/internal/clerk-js/sessionTasks' ;
2+ import { windowNavigate } from '@clerk/shared/internal/clerk-js/windowNavigate' ;
23import { useClerk } from '@clerk/shared/react' ;
34import type { DecorateUrl , SessionResource } from '@clerk/shared/types' ;
45import { createContext , useContext } from 'react' ;
@@ -43,7 +44,7 @@ export const useSessionTasksContext = (): SessionTasksContextType => {
4344 // If decorateUrl modified the URL (Safari ITP fix), do a full page navigation
4445 // The touch endpoint URL will be an absolute URL starting with http:// or https://
4546 if ( decoratedUrl !== redirectUrlComplete && / ^ h t t p s ? : \/ \/ / . test ( decoratedUrl ) ) {
46- window . location . href = decoratedUrl ;
47+ windowNavigate ( decoratedUrl ) ;
4748 return ;
4849 }
4950
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { SIGN_IN_INITIAL_VALUE_KEYS } from '@clerk/shared/internal/clerk-js/cons
22import { RedirectUrls } from '@clerk/shared/internal/clerk-js/redirectUrls' ;
33import { getTaskEndpoint } from '@clerk/shared/internal/clerk-js/sessionTasks' ;
44import { buildURL } from '@clerk/shared/internal/clerk-js/url' ;
5+ import { windowNavigate } from '@clerk/shared/internal/clerk-js/windowNavigate' ;
56import { useClerk } from '@clerk/shared/react' ;
67import type { DecorateUrl , SessionResource } from '@clerk/shared/types' ;
78import { isAbsoluteUrl } from '@clerk/shared/url' ;
@@ -140,7 +141,7 @@ export const useSignInContext = (): SignInContextType => {
140141 // If decorateUrl modified the URL (Safari ITP fix), do a full page navigation
141142 // The touch endpoint URL will be an absolute URL starting with http:// or https://
142143 if ( decoratedUrl !== redirectUrl && / ^ h t t p s ? : \/ \/ / . test ( decoratedUrl ) ) {
143- window . location . href = decoratedUrl ;
144+ windowNavigate ( decoratedUrl ) ;
144145 return ;
145146 }
146147
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { SIGN_UP_INITIAL_VALUE_KEYS } from '@clerk/shared/internal/clerk-js/cons
22import { RedirectUrls } from '@clerk/shared/internal/clerk-js/redirectUrls' ;
33import { getTaskEndpoint } from '@clerk/shared/internal/clerk-js/sessionTasks' ;
44import { buildURL } from '@clerk/shared/internal/clerk-js/url' ;
5+ import { windowNavigate } from '@clerk/shared/internal/clerk-js/windowNavigate' ;
56import { useClerk } from '@clerk/shared/react' ;
67import type { DecorateUrl , SessionResource } from '@clerk/shared/types' ;
78import { isAbsoluteUrl } from '@clerk/shared/url' ;
@@ -135,7 +136,7 @@ export const useSignUpContext = (): SignUpContextType => {
135136 // If decorateUrl modified the URL (Safari ITP fix), do a full page navigation
136137 // The touch endpoint URL will be an absolute URL starting with http:// or https://
137138 if ( decoratedUrl !== redirectUrl && / ^ h t t p s ? : \/ \/ / . test ( decoratedUrl ) ) {
138- window . location . href = decoratedUrl ;
139+ windowNavigate ( decoratedUrl ) ;
139140 return ;
140141 }
141142
You can’t perform that action at this time.
0 commit comments