From 63cca4eef2efeebc4452dcd005171e863cd4b5a7 Mon Sep 17 00:00:00 2001 From: hasan-deriv Date: Thu, 17 Oct 2024 17:02:48 +0800 Subject: [PATCH] feat: passed authorize data through AuthDataContext --- src/context/auth-context.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/context/auth-context.tsx b/src/context/auth-context.tsx index 20f9be8..f00dc2c 100644 --- a/src/context/auth-context.tsx +++ b/src/context/auth-context.tsx @@ -2,7 +2,7 @@ import { ReactNode, createContext, useCallback, useEffect, useMemo } from 'react import { URLUtils } from '@deriv-com/utils'; import { useAuthorize } from '../api/mutation/use-authorize'; import { useAppData } from '../base'; -import { TSocketError } from '../types/api.types'; +import { TSocketError, TSocketResponseData } from '../types/api.types'; import { useLogout } from '../api'; type AuthData = { @@ -13,6 +13,7 @@ type AuthData = { appendAccountLocalStorage: (loginid: string, token: string) => void; logout: () => void; error: TSocketError<'authorize'>['error'] | null; + data: TSocketResponseData<"authorize"> | undefined }; export const AuthDataContext = createContext(null); @@ -119,6 +120,7 @@ export const AuthDataProvider = ({ children }: AuthDataProviderProps) => { appendAccountLocalStorage, logout, isAuthorized, + data }), [activeLoginid, isSuccess, error, status] );