File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -113,8 +113,8 @@ export const AppProvider = ({ children }: { children: React.ReactNode }) => {
113
113
const login = useCallback ( async ( ) => {
114
114
const { authCode } = await authGitHub ( ) ;
115
115
const { token } = await getToken ( authCode ) ;
116
- const user = await getUserData ( token ) ;
117
116
const hostname = Constants . DEFAULT_AUTH_OPTIONS . hostname ;
117
+ const user = await getUserData ( token , hostname ) ;
118
118
const updatedAccounts = addAccount ( accounts , token , hostname , user ) ;
119
119
setAccounts ( updatedAccounts ) ;
120
120
saveState ( updatedAccounts , settings ) ;
@@ -138,7 +138,7 @@ export const AppProvider = ({ children }: { children: React.ReactNode }) => {
138
138
'HEAD' ,
139
139
token
140
140
) ;
141
- const user = await getUserData ( token ) ;
141
+ const user = await getUserData ( token , hostname ) ;
142
142
const updatedAccounts = addAccount ( accounts , token , hostname , user ) ;
143
143
setAccounts ( updatedAccounts ) ;
144
144
saveState ( updatedAccounts , settings ) ;
Original file line number Diff line number Diff line change @@ -68,9 +68,9 @@ export const authGitHub = (
68
68
} ) ;
69
69
} ;
70
70
71
- export const getUserData = async ( token : string ) : Promise < User > => {
71
+ export const getUserData = async ( token : string , hostname : string ) : Promise < User > => {
72
72
const response = await apiRequestAuth (
73
- `https://api.${ Constants . DEFAULT_AUTH_OPTIONS . hostname } /user` ,
73
+ `https://api.${ hostname } /user` ,
74
74
'GET' ,
75
75
token
76
76
) ;
You can’t perform that action at this time.
0 commit comments