 
   callback null
 
+ClientOnlyToken::expired = ->
+  !@expiresAt? or (Date.parse(@expiresAt) > (Date.now() + ONE_HOUR))
+
 ONE_HOUR = 1000 * 60 * 60
 
 ClientOnlyToken.ensure = (clientID, clientSecret, callback) ->

              cot = new ClientOnlyToken({clientID: clientID})
            cot.token = results.access_token
            # XXX: expiration in seconds or milliseconds?
            if !_.isNumber results.expires_in
              msg = "Expected results '#{body}' to include number 'expires_in'"
              callback new Error(msg)
            else
              expiresAt = new Date(Date.now() + (results.expires_in * 1000))
              cot.expiresAt = expiresAt.toISOString()

              cot.save (err) ->
                if err
                  callback err
                else
                  callback null, cot.token

module.exports = ClientOnlyToken

    if err && err.name != "NoSuchThingError"
      callback err
    else
      if cot && !cot.expired()
        callback null, cot.token
      else
        params =
