If you’re using Go on the server, this library will simplify writing the server-side portions of Cord.
Install the cord.com/server
package via go get
.
$ go get cord.com/server
import (
cord "cord.com/server"
)
func getClientAuthToken(u User, o Organization) (string, error) {
return cord.ClientAuthToken(kAppID, kSecret,
cord.ClientAuthTokenData{
UserID: u.id,
OrganizationID: o.id,
UserDetails: &cord.UserDetails{
Email: u.email,
Name: u.name,
ProfilePictureURL: u.profilePictureURL,
},
OrganizationDetails: &cord.OrganizationDetails{
Name: o.name,
},
})
}
The result will be a valid client auth token.
On this page