oauthjs / node-oauth2-server

Complete, compliant and well tested module for implementing an OAuth2 Server/Provider with express in node.js
https://npmjs.org/package/oauth2-server
MIT License
4.02k stars 931 forks source link

DeprecationWarning: Using a domain property in MakeCallback is deprecated. #537

Open AlbertHambardzumyan opened 6 years ago

AlbertHambardzumyan commented 6 years ago

Version: v3 (3.0.1)

Calling .authenticate() which triggers (at least):

Let's say the above fn successfully returns the object (fields: accessToken, accessTokenExpiresAt, client, user, scope)

static async getAccessToken (accessToken) {
      const token = await OAuth2AccessTokensModel.getOauth2AccessToken(accessToken)
      if (!token) {
        throw new ResourceNotFoundError(`The token for ${accessToken} is not found.`))
      }

      const { accessTokenExpiresAt, clientId, userId, scope } = token

      return { accessToken, accessTokenExpiresAt, scope, client: { id: clientId }, user: { id: userId } }
  }

However, the token is expired and the library returns error (invalid_token) on .authenticate() call and deprecation warning.

Any thoughts on deprecation warning? (node:22198) [DEP0097] DeprecationWarning: Using a domain property in MakeCallback is deprecated. Use the async_context variant of MakeCallback or the AsyncResource class instead.

maximkoev commented 4 years ago

I faced the same problem. Am not sure but seems there is cause of float problem, blank page on navigate. Sometimes test hangs on load page. node v10.16.3

thomseddon commented 4 years ago

We don't use the domain module ourselves, so I suspect this will have been due to an outdated library (which have now been updated).

Do you happen to have a minimal example to replicate the issue?