question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question: Dynamically updating the auth headers

See original GitHub issue

Hello,

so far it was possible to update the auth header after instantiation. Since v7.1.0 the global config object is no longer used and

pusher.config.auth.headers.Authorization = 'Bearer <access-token>';

no longer works. Is it still possible to change the authOptions after instantiation?

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:4
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
onuragtashcommented, Sep 2, 2022

@ivial98 customHandler takes two parameters. First one is your payload. And second one is a callback.

export declare type ChannelAuthorizationCallback = (error: Error | null, authData: ChannelAuthorizationData | null) => void;

Just you need to trigger callback with the response of your fetch result.

No need to return anything.

2reactions
benw-pushercommented, Dec 16, 2022

Not sure why Stalebot closed this… In any case, we have now released a new version of the library that supports two new functions - headersProvider and paramsProvider - that allow you to retrieve the necessary header/param values at the time of the auth request instead of the current method of defining them at the time of instantiation.

These functions are available in v7.6.0. I will leave this as closed as the fix has been released.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Question: Dynamically updating the auth headers · Issue #18
Atm I've managed to update the Pusher object after the user has logged in, using something like: pusher.client.config.auth.headers.Authorization ...
Read more >
How to dynamically set headers in Retrofit (Android)
A request Header can be updated dynamically using the @Header annotation. A corresponding parameter must be provided to the @Header.
Read more >
Specifying a dynamic authorization header ... - Documentation
On the Configure Data Source Filters screen, enter the access token attribute name in the Authorization Header field. Example Authorization ...
Read more >
How to dynamically set the Authenticate key in the http ...
We are implementing an integration using REST Api ,and in that we are having the same end point but different Authentication Keys for ......
Read more >
[Res] How to set Authorization header value dynamically
We're about to add support for authentication. Once that is in, each of my REST requests needs to send an Authorization header where...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found