You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to add a Bearer token to the requests automatically.
An optional function which can modify the headers would solve this issue.
Sample:
newwindow.EmbeddedSandbox({target: '#sandbox',initialEndpoint: window.location.href,initialState: {sharedHeaders: {'X-SpecialHeader': 'WILL_BE_REPLACED_AUTOMATICALLY'}},modifyHeaders: async(url,headers)=>{// Add Authorization header if not providedif(!headers.Authorization){constaccessToken=awaitwindow.getAccessToken();headers.Authorization='Bearer '+accessToken;}// Modify special header if shared header is not uncheckedif(headers['X-SpecialHeader']==='WILL_BE_REPLACED_AUTOMATICALLY'){constspecial=awaitwindow.getTheValue();headers['X-SpecialHeader']=special;}returnheaders;}});
I would like to add a Bearer token to the requests automatically.
An optional function which can modify the headers would solve this issue.
Sample:
I already provided a PR for this. #307
The text was updated successfully, but these errors were encountered: