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
* Add authenticateUser function and deprecate authenticate in favor of authorizeChannel
* Send To User
* feat: add terminate user connections function
Co-authored-by: Meena Alfons <[email protected]>
Co-authored-by: Agata Walukiewicz <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+33-6Lines changed: 33 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -241,7 +241,7 @@ pusher
241
241
242
242
This library supports end-to-end encryption of your private channels. This means that only you and your connected clients will be able to read your messages. Pusher cannot decrypt them. You can enable this feature by following these steps:
243
243
244
-
1. You should first set up Private channels. This involves [creating an authentication endpoint on your server](https://pusher.com/docs/authenticating_users).
244
+
1. You should first set up Private channels. This involves [creating an authorization endpoint on your server](https://pusher.com/docs/authenticating_users).
245
245
246
246
2. Next, generate your 32 byte master encryption key, encode it as base64 and pass it to the Pusher constructor.
Rationale: the methods in this library map directly to individual Channels HTTP API requests. If we allowed triggering a single event on multiple channels (some encrypted, some unencrypted), then it would require two API requests: one where the event is encrypted to the encrypted channels, and one where the event is unencrypted for unencrypted channels.
280
280
281
-
### Authenticating private channels
281
+
### Authenticating users
282
282
283
-
To authorise your users to access private channels on Pusher Channels, you can use the `authenticate` function:
283
+
To authenticate users during sign in, you can use the `authenticateUser` function:
The `userData` parameter must contain an `id` property with a non empty string. For more information see: <http://pusher.com/docs/authenticating_users>
295
+
296
+
### Terminating user connections
297
+
298
+
In order to terminate a user's connections, the user must have been authenticated. Check the [Server user authentication docs](http://pusher.com/docs/authenticating_users) for the information on how to create a user authentication endpoint.
299
+
300
+
To terminate all connections established by a given user, you can use the `terminateUserConnections` function:
301
+
302
+
```javascript
303
+
pusher.terminateUserConnections(userId)
304
+
```
305
+
306
+
Please note, that it only terminates the user's active connections. This means, if nothing else is done, the user will be able to reconnect. For more information see: [Terminating user connections docs](https://pusher.com/docs/channels/server_api/terminating-user-connections/).
307
+
308
+
### Private channel authorisation
309
+
310
+
To authorise your users to access private channels on Pusher Channels, you can use the `authorizeChannel` function:
0 commit comments