File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed
Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,31 @@ describe('InstagramAdapter', function () {
101101 'Instagram auth is invalid for this user.'
102102 ) ;
103103 } ) ;
104+
105+ it ( 'should ignore client-provided apiURL and use hardcoded endpoint' , async ( ) => {
106+ const accessToken = 'mockAccessToken' ;
107+ const authData = {
108+ id : 'mockUserId' ,
109+ apiURL : 'https://example.com/' ,
110+ } ;
111+
112+ mockFetch ( [
113+ {
114+ url : 'https://graph.instagram.com/me?fields=id&access_token=mockAccessToken' ,
115+ method : 'GET' ,
116+ response : {
117+ ok : true ,
118+ json : ( ) =>
119+ Promise . resolve ( {
120+ id : 'mockUserId' ,
121+ } ) ,
122+ } ,
123+ } ,
124+ ] ) ;
125+
126+ const user = await adapter . getUserFromAccessToken ( accessToken , authData ) ;
127+ expect ( user ) . toEqual ( { id : 'mockUserId' } ) ;
128+ } ) ;
104129 } ) ;
105130
106131 describe ( 'InstagramAdapter E2E Test' , function ( ) {
Original file line number Diff line number Diff line change @@ -96,8 +96,7 @@ class InstagramAdapter extends BaseAuthCodeAdapter {
9696 }
9797
9898 async getUserFromAccessToken ( accessToken , authData ) {
99- const defaultURL = 'https://graph.instagram.com/' ;
100- const apiURL = authData . apiURL || defaultURL ;
99+ const apiURL = 'https://graph.instagram.com/' ;
101100 const path = `${ apiURL } me?fields=id&access_token=${ accessToken } ` ;
102101
103102 const response = await fetch ( path ) ;
You can’t perform that action at this time.
0 commit comments