Skip to content

Commit b99dd6e

Browse files
authored
Merge pull request #221 from rupato-deriv/Rupato/Fix-api-login-flow
Rupato/fix api login flow
2 parents 0741984 + 16fc8dd commit b99dd6e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/features/Callback/CallbackPage.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@ import React from 'react';
22
import { Callback } from '@deriv-com/auth-client';
33
import { transformAccountsFromResponseBody } from '@site/src/utils';
44
import useAuthContext from '@site/src/hooks/useAuthContext';
5+
import { useHistory } from '@docusaurus/router';
6+
57
const CallbackPage = () => {
68
const { updateLoginAccounts } = useAuthContext();
9+
const history = useHistory();
10+
711
return (
812
<Callback
913
onSignInSuccess={(tokens) => {
1014
const accounts = transformAccountsFromResponseBody(tokens);
1115
updateLoginAccounts(accounts);
12-
window.location.href = '/';
16+
history.push('/');
1317
}}
1418
/>
1519
);

0 commit comments

Comments
 (0)