Commit 91d9e86 1 parent 6cea6b9 commit 91d9e86 Copy full SHA for 91d9e86
File tree 4 files changed +19
-8
lines changed
4 files changed +19
-8
lines changed Original file line number Diff line number Diff line change 18
18
"@babel/preset-env" : " ^7.24.5" ,
19
19
"@chakra-ui/react" : " ^2.8.2" ,
20
20
"@deriv-com/analytics" : " ^1.10.1" ,
21
- "@deriv-com/api-hooks" : " ^1.4.5 " ,
21
+ "@deriv-com/api-hooks" : " ^1.4.7 " ,
22
22
"@deriv-com/translations" : " ^1.2.4" ,
23
23
"@deriv-com/ui" : " ^1.29.0" ,
24
24
"@deriv-com/utils" : " ^0.0.28" ,
Original file line number Diff line number Diff line change 1
1
import { getOauthUrl } from '@/constants' ;
2
- import { api } from '@/hooks' ;
2
+ import { api , useRedirectToOauth } from '@/hooks' ;
3
3
import { getCurrentRoute } from '@/utils' ;
4
4
import { StandaloneCircleUserRegularIcon } from '@deriv/quill-icons' ;
5
5
import { useAuthData } from '@deriv-com/api-hooks' ;
@@ -19,6 +19,7 @@ import './AppHeader.scss';
19
19
const AppHeader = ( ) => {
20
20
const { isDesktop } = useDevice ( ) ;
21
21
const isEndpointPage = getCurrentRoute ( ) === 'endpoint' ;
22
+ const { redirectToOauth } = useRedirectToOauth ( ) ;
22
23
const { activeLoginid, logout } = useAuthData ( ) ;
23
24
const { data : activeAccount } = api . account . useActiveAccount ( ) ;
24
25
const { localize } = useTranslations ( ) ;
@@ -46,7 +47,14 @@ const AppHeader = () => {
46
47
</ TooltipMenuIcon >
47
48
) }
48
49
< AccountSwitcher account = { activeAccount ! } />
49
- < Button className = 'mr-6' onClick = { logout } size = 'md' >
50
+ < Button
51
+ className = 'mr-6'
52
+ onClick = { async ( ) => {
53
+ await logout ( ) ;
54
+ redirectToOauth ( ) ;
55
+ } }
56
+ size = 'md'
57
+ >
50
58
< Text size = 'sm' weight = 'bold' >
51
59
{ localize ( 'Logout' ) }
52
60
</ Text >
Original file line number Diff line number Diff line change @@ -118,7 +118,9 @@ export const MobileMenuConfig = () => {
118
118
as : 'button' ,
119
119
label : localize ( 'Log out' ) ,
120
120
LeftComponent : LegacyLogout1pxIcon ,
121
- onClick : logout ,
121
+ onClick : async ( ) => {
122
+ await logout ( ) ;
123
+ } ,
122
124
removeBorderBottom : true ,
123
125
} ,
124
126
] ,
You can’t perform that action at this time.
0 commit comments