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

TOKEN lifetime #15

Open
FeeFelipe opened this issue Apr 26, 2017 · 1 comment
Open

TOKEN lifetime #15

FeeFelipe opened this issue Apr 26, 2017 · 1 comment

Comments

@FeeFelipe
Copy link

FeeFelipe commented Apr 26, 2017

Hi,

I tried to set lifetime token, but the application keeps (60 * 60) from default settings

function getClient(clientId, clientSecret) {
  console.log("getClient",clientId, clientSecret)
  const options = {client_id: clientId};
  if (clientSecret) options.client_secret = clientSecret;

  return OAuthClient
    .findOne(options)
    .then(function (client) {
      if (!client) return new Error("client not found");
      var clientWithGrants = client
      clientWithGrants.grants = ['authorization_code', 'password', 'refresh_token', 'client_credentials']
      // Todo: need to create another table for redirect URIs
      clientWithGrants.redirectUris = [clientWithGrants.redirect_uri]
      delete clientWithGrants.redirect_uri
      clientWithGrants.refreshTokenLifetime = 9600
      clientWithGrants.accessTokenLifetime  = 10
      return clientWithGrants
    }).catch(function (err) {
      console.log("getClient - Err: ", err)
    });
}
@manjeshpv
Copy link
Owner

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

2 participants