Skip to content

Commit f00289c

Browse files
Introduce headersProvider and paramsProvider to auth options (#639)
Bump to version 7.6.0 Co-authored-by: Pusher CI <[email protected]>
1 parent ebc3aa7 commit f00289c

35 files changed

+588
-78
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 7.6.0
4+
5+
- [ADDED] Introduce and to channel authorization and user authentication in order to allow for changing header and param values after the Pusher object is initialized.
6+
37
## 7.5.0
48

59
- [ADDED] Watchlist Online Status

README.md

+11-3
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,10 @@ var presenceChannel: PusherTypes.PresenceChannel;
144144

145145
### React Native
146146

147-
> **⚠️ Important notice**
147+
> **⚠️ Important notice**
148+
>
149+
> React Native support has been **deprecated** and soon will be removed from this repository.
148150
>
149-
> React Native support has been **deprecated** and soon will be removed from this repository.
150-
>
151151
> Please, use our official [React Native SDK](https://github.com/pusher/pusher-websocket-react-native) instead.
152152
153153
### Web Workers
@@ -232,6 +232,10 @@ Object containing the configuration for user authentication. Valid keys are:
232232

233233
* `headers` (Object) - Only applied when using `ajax` as authentication transport. Provides the ability to pass additional HTTP Headers to the user authentication endpoint. This can be useful with some web application frameworks that guard against CSRF CSRF (Cross-site request forgery).
234234

235+
* `paramsProvider` (Function) - When present, this function is called to get additional parameters to be sent when the user authentication endpoint is called. This is equivalent to passing them on the params key, but allows for the parameters to be retrieved dynamically at the time of the request.
236+
237+
* `headersProvider` (Function) - When present, this function is called to get additional headers to be sent when the user authentication endpoint is called. This is equivalent to passing them on the headers key, but allows for the headers to be retrieved dynamically at the time of the request.
238+
235239
* `customHandler` (Function) - When present, this function is called instead of a request being made to the endpoint specified by `userAuthentication.endpoint`.
236240

237241

@@ -252,6 +256,10 @@ Object containing the configuration for user authorization. Valid keys are:
252256

253257
* `headers` (Object) - Only applied when using `ajax` as authorizing transport. Provides the ability to pass additional HTTP Headers to the user authorization endpoint. This can be useful with some web application frameworks that guard against CSRF CSRF (Cross-site request forgery).
254258

259+
* `paramsProvider` (Function) - When present, this function is called to get additional parameters to be sent when the user authentication endpoint is called. This is equivalent to passing them on the params key, but allows for the parameters to be retrieved dynamically at the time of the request.
260+
261+
* `headersProvider` (Function) - When present, this function is called to get additional headers to be sent when the user authentication endpoint is called. This is equivalent to passing them on the headers key, but allows for the headers to be retrieved dynamically at the time of the request.
262+
255263
* `customHandler` (Function) - When present, this function is called instead of a request being made to the endpoint specified by `channelAuthorization.endpoint`.
256264

257265

dist/node/pusher.js

+34-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/node/pusher.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/react-native/pusher.js

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/react-native/pusher.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/web/pusher-with-encryption.js

+36-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/web/pusher-with-encryption.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/web/pusher-with-encryption.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/web/pusher-with-encryption.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/web/pusher.js

+36-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/web/pusher.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/web/pusher.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/web/pusher.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/worker/pusher-with-encryption.worker.js

+34-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/worker/pusher-with-encryption.worker.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/worker/pusher-with-encryption.worker.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/worker/pusher-with-encryption.worker.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)