@@ -18,7 +18,7 @@ const Request = require('../request');
1818const Response = require ( '../response' ) ;
1919const ServerError = require ( '../errors/server-error' ) ;
2020const UnauthorizedClientError = require ( '../errors/unauthorized-client-error' ) ;
21- const is = require ( '../validator/is ' ) ;
21+ const isFormat = require ( '@node-oauth/formats ' ) ;
2222const tokenUtil = require ( '../utils/token-util' ) ;
2323const url = require ( 'url' ) ;
2424
@@ -171,13 +171,13 @@ AuthorizeHandler.prototype.getClient = function(request) {
171171 throw new InvalidRequestError ( 'Missing parameter: `client_id`' ) ;
172172 }
173173
174- if ( ! is . vschar ( clientId ) ) {
174+ if ( ! isFormat . vschar ( clientId ) ) {
175175 throw new InvalidRequestError ( 'Invalid parameter: `client_id`' ) ;
176176 }
177177
178178 const redirectUri = request . body . redirect_uri || request . query . redirect_uri ;
179179
180- if ( redirectUri && ! is . uri ( redirectUri ) ) {
180+ if ( redirectUri && ! isFormat . uri ( redirectUri ) ) {
181181 throw new InvalidRequestError ( 'Invalid request: `redirect_uri` is not a valid URI' ) ;
182182 }
183183 return promisify ( this . model . getClient , 2 ) . call ( this . model , clientId , null )
@@ -230,7 +230,7 @@ AuthorizeHandler.prototype.validateScope = function(user, client, scope) {
230230AuthorizeHandler . prototype . getScope = function ( request ) {
231231 const scope = request . body . scope || request . query . scope ;
232232
233- if ( ! is . nqschar ( scope ) ) {
233+ if ( ! isFormat . nqschar ( scope ) ) {
234234 throw new InvalidScopeError ( 'Invalid parameter: `scope`' ) ;
235235 }
236236
@@ -245,7 +245,7 @@ AuthorizeHandler.prototype.getState = function(request) {
245245 const state = request . body . state || request . query . state ;
246246 const stateExists = state && state . length > 0 ;
247247 const stateIsValid = stateExists
248- ? is . vschar ( state )
248+ ? isFormat . vschar ( state )
249249 : this . allowEmptyState ;
250250
251251 if ( ! stateIsValid ) {
0 commit comments