Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Watchlist with Springboot #369

Open
kitare17 opened this issue Sep 10, 2024 · 0 comments
Open

Watchlist with Springboot #369

kitare17 opened this issue Sep 10, 2024 · 0 comments

Comments

@kitare17
Copy link

What is the issue?

I use this method to authenticate user with
@PostMapping("/pusher/user-auth")
public ResponseEntity userAuthP() {
System.out.println("POST user auth");
PusherOptions options =
new PusherOptions()
.setUserAuthenticator(new HttpUserAuthenticator("http://127.0.0.1:5500/checkonline.html"));
com.pusher.client.Pusher pusher = new com.pusher.client.Pusher(key, options);

    pusher.signin();
    Map<String, String> stringStringMap = new HashMap<>();
    stringStringMap.put("auth", "user");
    stringStringMap.put("user_data", "test");
    return ResponseEntity.ok(stringStringMap);
}

In FE, I use
pusher.signin();

    const watchlistEventHandler = (event) => {
        console.log("Watching list", event);

    };
    pusher.user.watchlist.bind('online', watchlistEventHandler);
    pusher.user.watchlist.bind('offline', watchlistEventHandler);

but check in console log
image
How can I config with java in right way?
CC @pusher/mobile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant