File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 11import { useQuery } from '@tanstack/react-query'
22
33import { getAuthToken } from '../utils/auth'
4- import { getApiClient } from '../utils/codebuff-api'
4+ import { getApiClient , setApiClientAuthToken } from '../utils/codebuff-api'
55import { logger as defaultLogger } from '../utils/logger'
66
77import type {
@@ -37,8 +37,13 @@ export async function fetchUserDetails<T extends UserField>({
3737 logger = defaultLogger ,
3838 apiClient : providedApiClient ,
3939} : FetchUserDetailsParams < T > ) : Promise < UserDetails < T > | null > {
40- const apiClient =
41- providedApiClient ?? getApiClient ( )
40+ let apiClient : CodebuffApiClient
41+ if ( providedApiClient ) {
42+ apiClient = providedApiClient
43+ } else {
44+ setApiClientAuthToken ( authToken )
45+ apiClient = getApiClient ( )
46+ }
4247
4348 const response = await apiClient . me ( fields )
4449
You can’t perform that action at this time.
0 commit comments