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

Pusher Channels Docs | How to authorize userspage #223

Open
ovieokeh opened this issue Nov 4, 2022 · 0 comments
Open

Pusher Channels Docs | How to authorize userspage #223

ovieokeh opened this issue Nov 4, 2022 · 0 comments

Comments

@ovieokeh
Copy link
Contributor

ovieokeh commented Nov 4, 2022

Hello there, I spotted an issue on https://pusher.com/docs/channels/server_api/authorizing-users/

The Go code snippet for Implementing the authorization endpoint for a private channel should —

  • I think it's a good idea to show the relevant imports and any assumed global variables like so (also applies to all code snippets)
import (
	"fmt"
	"io/ioutil"
	"net/http"
        "github.com/pusher/pusher-http-go"
)

var pusherClient = pusher.Client{
	AppID:   "",
	Key:     "",
	Secret:  "",
	Cluster: "",
}
... rest of code snippet

Bonus issues

  • The Go snippet in this section has a small bug with the pusher.MemberData line.
presenceData := pusher.MemberData{
  UserId: "1",  //should be UserID
  UserInfo: map[string]string{
    "twitter": "pusher",
  },
}
  • In the same snippet referenced above, the fmt.Fprintf line also has a tiny bug
fmt.Fprintf(res, response) // should be fmt.Fprintf(res, string(response))
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