From 47d14e31fb7d34f648d2daa33862194e800b26c1 Mon Sep 17 00:00:00 2001 From: Jeff Flynt Date: Tue, 2 Jul 2024 13:55:26 -0500 Subject: [PATCH] Fix linting issues --- lib/model/meteor-model.js | 8 ++++---- lib/model/model.js | 2 +- lib/oauth.js | 2 +- lib/validation/requiredRefreshTokenPostParams.js | 10 +++++----- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/model/meteor-model.js b/lib/model/meteor-model.js index bb7ffbd..fe5c2cc 100644 --- a/lib/model/meteor-model.js +++ b/lib/model/meteor-model.js @@ -109,7 +109,7 @@ export const saveAuthorizationCode = bind(function saveAuthCode (code, client, u redirectUri, scope: code.scope, client: { - id: client.client_id + id: client.clientId }, user: { id: user.id @@ -151,10 +151,10 @@ export const getRefreshToken = bind(function (refreshToken) { }) export const revokeToken = bind(function (token) { - const docCount = collections.AccessTokens.find({ refreshToken: token.refreshToken }).count(); + const docCount = collections.AccessTokens.find({ refreshToken: token.refreshToken }).count() if (docCount === 0) { - return true; + return true } - return collections.AccessTokens.remove({ refreshToken: token.refreshToken }) === docCount; + return collections.AccessTokens.remove({ refreshToken: token.refreshToken }) === docCount }) diff --git a/lib/model/model.js b/lib/model/model.js index 083c842..8231e22 100644 --- a/lib/model/model.js +++ b/lib/model/model.js @@ -179,7 +179,7 @@ class OAuthMeteorModel { /** * revokeToken(refreshToken) is required and should return true */ - async revokeToken(refreshToken) { + async revokeToken (refreshToken) { this.log(`revokeToken (refreshToken: ${refreshToken})`) return revokeToken(refreshToken) } diff --git a/lib/oauth.js b/lib/oauth.js index 4f2f773..0305a3b 100644 --- a/lib/oauth.js +++ b/lib/oauth.js @@ -17,7 +17,7 @@ import { validateParams } from './validation/validateParams' import { requiredAuthorizeGetParams } from './validation/requiredAuthorizeGetParams' import { requiredAuthorizePostParams } from './validation/requiredAuthorizePostParams' import { requiredAccessTokenPostParams } from './validation/requiredAccessTokenPostParams' -import { requiredRefreshTokenPostParams } from "./validation/requiredRefreshTokenPostParams"; +import { requiredRefreshTokenPostParams } from './validation/requiredRefreshTokenPostParams'; import { UserValidation } from './validation/UserValidation' import { OptionsSchema } from './validation/OptionsSchema' diff --git a/lib/validation/requiredRefreshTokenPostParams.js b/lib/validation/requiredRefreshTokenPostParams.js index e577f1a..59588fc 100644 --- a/lib/validation/requiredRefreshTokenPostParams.js +++ b/lib/validation/requiredRefreshTokenPostParams.js @@ -1,11 +1,11 @@ -import { Match } from "meteor/check"; -import { nonEmptyString } from "./nonEmptyString"; +import { Match } from 'meteor/check' +import { nonEmptyString } from './nonEmptyString' -const isNonEmptyString = Match.Where(nonEmptyString); +const isNonEmptyString = Match.Where(nonEmptyString) export const requiredRefreshTokenPostParams = { grant_type: isNonEmptyString, refresh_token: isNonEmptyString, client_id: Match.Maybe(String), - client_secret: Match.Maybe(String), -}; + client_secret: Match.Maybe(String) +}