Link copied to clipboard!

Go

If you’re using Go on the server, this library will simplify writing the server-side portions of Cord.

Installation

Install the cord.com/server package via go get.

$ go get cord.com/server

Signing client auth tokens

Usage

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.

In this section