chinloyal / pusher_client

A Pusher Channels Client for Fluttter (Fully supports Android and iOS)
https://pusher.com/channels
MIT License
42 stars 175 forks source link

auth not working #47

Open adham-ashraf77 opened 2 years ago

adham-ashraf77 commented 2 years ago

Steps to reproduce

I want to auth to

pusher = new PusherClient(
      "name",
      PusherOptions(
        // if local on android use 10.0.2.2
        host: "hostname",
        wsPort: 6001,
        wssPort: 6002,
        encrypted: true,
        auth: PusherAuth(
          "api/link/broadcasting/auth",
          headers: {

            HttpHeaders.authorizationHeader:
                "Bearer " + LocalStorage.getData(key: "TokenUserLoad"),

          },
        ),
      ),
      enableLogging: true,
    );

Expected behaviour

to access auth

Actual behaviour

not access auth android or ios

...

adham-ashraf77 commented 2 years ago

auth pusher still have the same value if login again to new user any ideas what to do?

channel!.unbind(".order.message");
pusher!.unsubscribe(
    "private-orders.${BaseUrlApi.chefOrClient}.${widget.orderId}");
pusher?.cancelEventChannelStream();
pusher!.disconnect();
devadrianapostol commented 1 year ago

Same here. I also ran into this issue. I get same user even in the backend, I use a Laravel for BE, I get same old user in the channel routing even if I logged in as a different one.