@@ -18,7 +18,7 @@ const Request = require('../request');
18
18
const Response = require ( '../response' ) ;
19
19
const ServerError = require ( '../errors/server-error' ) ;
20
20
const UnauthorizedClientError = require ( '../errors/unauthorized-client-error' ) ;
21
- const is = require ( '../validator/is ' ) ;
21
+ const isFormat = require ( '@node-oauth/formats ' ) ;
22
22
const tokenUtil = require ( '../utils/token-util' ) ;
23
23
const url = require ( 'url' ) ;
24
24
@@ -171,13 +171,13 @@ AuthorizeHandler.prototype.getClient = function(request) {
171
171
throw new InvalidRequestError ( 'Missing parameter: `client_id`' ) ;
172
172
}
173
173
174
- if ( ! is . vschar ( clientId ) ) {
174
+ if ( ! isFormat . vschar ( clientId ) ) {
175
175
throw new InvalidRequestError ( 'Invalid parameter: `client_id`' ) ;
176
176
}
177
177
178
178
const redirectUri = request . body . redirect_uri || request . query . redirect_uri ;
179
179
180
- if ( redirectUri && ! is . uri ( redirectUri ) ) {
180
+ if ( redirectUri && ! isFormat . uri ( redirectUri ) ) {
181
181
throw new InvalidRequestError ( 'Invalid request: `redirect_uri` is not a valid URI' ) ;
182
182
}
183
183
return promisify ( this . model . getClient , 2 ) . call ( this . model , clientId , null )
@@ -230,7 +230,7 @@ AuthorizeHandler.prototype.validateScope = function(user, client, scope) {
230
230
AuthorizeHandler . prototype . getScope = function ( request ) {
231
231
const scope = request . body . scope || request . query . scope ;
232
232
233
- if ( ! is . nqschar ( scope ) ) {
233
+ if ( ! isFormat . nqschar ( scope ) ) {
234
234
throw new InvalidScopeError ( 'Invalid parameter: `scope`' ) ;
235
235
}
236
236
@@ -245,7 +245,7 @@ AuthorizeHandler.prototype.getState = function(request) {
245
245
const state = request . body . state || request . query . state ;
246
246
const stateExists = state && state . length > 0 ;
247
247
const stateIsValid = stateExists
248
- ? is . vschar ( state )
248
+ ? isFormat . vschar ( state )
249
249
: this . allowEmptyState ;
250
250
251
251
if ( ! stateIsValid ) {
0 commit comments