Unable to revoke JWT token


#1

I am creating a jwt with refresh token. When i try to revoke it it successfully updates the is_revoked field to 1 in the database but doesn’t invalidate that token.

// Generate new tokens
  const token = await auth.authenticator('jwt').withRefreshToken().generate( user )

My logout method

async logout ({request, response, auth}) {
  try {
  	const apiToken = auth.getAuthHeader()
  	await auth.authenticator('jwt').revokeTokens([apiToken])

    const user = await auth.authenticator('jwt').getUser()
    await auth.authenticator('jwt').revokeTokensForUser(user)

    // Clear device token
    user.device_token = ''
    await user.save()

  } catch (err) {
  	console.log( err );
  }

  response.messageResponse('User has been logged-out successfully.')
}