Skip to content

Commit b26cad4

Browse files
committed
feat(react): integrate navigate utility for signInUrl handling in SignInButton
1 parent 494e681 commit b26cad4

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/react/src/components/actions/SignInButton/SignInButton.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* under the License.
1717
*/
1818

19-
import {AsgardeoRuntimeError} from '@asgardeo/browser';
19+
import {AsgardeoRuntimeError, navigate} from '@asgardeo/browser';
2020
import {forwardRef, ForwardRefExoticComponent, MouseEvent, ReactElement, Ref, RefAttributes, useState} from 'react';
2121
import BaseSignInButton, {BaseSignInButtonProps} from './BaseSignInButton';
2222
import useAsgardeo from '../../../contexts/Asgardeo/useAsgardeo';
@@ -87,9 +87,7 @@ const SignInButton: ForwardRefExoticComponent<SignInButtonProps & RefAttributes<
8787

8888
// If a custom `signInUrl` is provided, use it for navigation.
8989
if (signInUrl) {
90-
window.history.pushState(null, '', signInUrl);
91-
92-
window.dispatchEvent(new PopStateEvent('popstate', {state: null}));
90+
navigate(signInUrl);
9391
} else {
9492
await signIn(overriddenSignInOptions ?? signInOptions);
9593
}

0 commit comments

Comments
 (0)