@@ -118,13 +118,13 @@ declare namespace OAuth2Server {
118118 * Generate access token. Calls Model#generateAccessToken() if implemented.
119119 *
120120 */
121- generateAccessToken ( client : Client , user : User , scope : string | string [ ] ) : Promise < string > ;
121+ generateAccessToken ( client : Client , user : User , scope : string [ ] ) : Promise < string > ;
122122
123123 /**
124124 * Generate refresh token. Calls Model#generateRefreshToken() if implemented.
125125 *
126126 */
127- generateRefreshToken ( client : Client , user : User , scope : string | string [ ] ) : Promise < string > ;
127+ generateRefreshToken ( client : Client , user : User , scope : string [ ] ) : Promise < string > ;
128128
129129 /**
130130 * Get access token expiration date.
@@ -142,13 +142,13 @@ declare namespace OAuth2Server {
142142 * Get scope from the request body.
143143 *
144144 */
145- getScope ( request : Request ) : string ;
145+ getScope ( request : Request ) : string [ ] ;
146146
147147 /**
148148 * Validate requested scope. Calls Model#validateScope() if implemented.
149149 *
150150 */
151- validateScope ( user : User , client : Client , scope : string | string [ ] ) : Promise < string | string [ ] | Falsey > ;
151+ validateScope ( user : User , client : Client , scope : string [ ] ) : Promise < string [ ] | Falsey > ;
152152
153153 /**
154154 * Retrieve info from the request and client and return token
@@ -168,7 +168,7 @@ declare namespace OAuth2Server {
168168 /**
169169 * The scope(s) to authenticate.
170170 */
171- scope ?: string | string [ ] | undefined ;
171+ scope ?: string [ ] | undefined ;
172172
173173 /**
174174 * Set the X-Accepted-OAuth-Scopes HTTP header on response objects.
@@ -245,7 +245,7 @@ declare namespace OAuth2Server {
245245 * Invoked to generate a new access token.
246246 *
247247 */
248- generateAccessToken ?( client : Client , user : User , scope : string | string [ ] ) : Promise < string > ;
248+ generateAccessToken ?( client : Client , user : User , scope : string [ ] ) : Promise < string > ;
249249
250250 /**
251251 * Invoked to retrieve a client using a client id or a client id/client secret combination, depending on the grant type.
@@ -272,21 +272,21 @@ declare namespace OAuth2Server {
272272 * Optional, if a custom authenticateHandler is used or if there is no scope part of the request.
273273 *
274274 */
275- verifyScope ( token : Token , scope : string | string [ ] ) : Promise < boolean > ;
275+ verifyScope ? ( token : Token , scope : string [ ] ) : Promise < boolean > ;
276276 }
277277
278278 interface AuthorizationCodeModel extends BaseModel , RequestAuthenticationModel {
279279 /**
280280 * Invoked to generate a new refresh token.
281281 *
282282 */
283- generateRefreshToken ?( client : Client , user : User , scope : string | string [ ] ) : Promise < string > ;
283+ generateRefreshToken ?( client : Client , user : User , scope : string [ ] ) : Promise < string > ;
284284
285285 /**
286286 * Invoked to generate a new authorization code.
287287 *
288288 */
289- generateAuthorizationCode ?( client : Client , user : User , scope : string | string [ ] ) : Promise < string > ;
289+ generateAuthorizationCode ?( client : Client , user : User , scope : string [ ] ) : Promise < string > ;
290290
291291 /**
292292 * Invoked to retrieve an existing authorization code previously saved through Model#saveAuthorizationCode().
@@ -314,8 +314,8 @@ declare namespace OAuth2Server {
314314 * Invoked to check if the requested scope is valid for a particular client/user combination.
315315 *
316316 */
317- validateScope ?( user : User , client : Client , scope : string | string [ ] ) : Promise < string | string [ ] | Falsey > ;
318-
317+ validateScope ?( user : User , client : Client , scope : string [ ] ) : Promise < string [ ] | Falsey > ;
318+
319319 /**
320320 * Invoked to check if the provided `redirectUri` is valid for a particular `client`.
321321 *
@@ -328,7 +328,7 @@ declare namespace OAuth2Server {
328328 * Invoked to generate a new refresh token.
329329 *
330330 */
331- generateRefreshToken ?( client : Client , user : User , scope : string | string [ ] ) : Promise < string > ;
331+ generateRefreshToken ?( client : Client , user : User , scope : string [ ] ) : Promise < string > ;
332332
333333 /**
334334 * Invoked to retrieve a user using a username/password combination.
@@ -340,15 +340,15 @@ declare namespace OAuth2Server {
340340 * Invoked to check if the requested scope is valid for a particular client/user combination.
341341 *
342342 */
343- validateScope ?( user : User , client : Client , scope : string | string [ ] ) : Promise < string | string [ ] | Falsey > ;
343+ validateScope ?( user : User , client : Client , scope : string [ ] ) : Promise < string [ ] | Falsey > ;
344344 }
345345
346346 interface RefreshTokenModel extends BaseModel , RequestAuthenticationModel {
347347 /**
348348 * Invoked to generate a new refresh token.
349349 *
350350 */
351- generateRefreshToken ?( client : Client , user : User , scope : string | string [ ] ) : Promise < string > ;
351+ generateRefreshToken ?( client : Client , user : User , scope : string [ ] ) : Promise < string > ;
352352
353353 /**
354354 * Invoked to retrieve an existing refresh token previously saved through Model#saveToken().
@@ -374,7 +374,7 @@ declare namespace OAuth2Server {
374374 * Invoked to check if the requested scope is valid for a particular client/user combination.
375375 *
376376 */
377- validateScope ?( user : User , client : Client , scope : string | string [ ] ) : Promise < string | string [ ] | Falsey > ;
377+ validateScope ?( user : User , client : Client , scope : string [ ] ) : Promise < string [ ] | Falsey > ;
378378 }
379379
380380 interface ExtensionModel extends BaseModel , RequestAuthenticationModel { }
@@ -406,7 +406,7 @@ declare namespace OAuth2Server {
406406 authorizationCode : string ;
407407 expiresAt : Date ;
408408 redirectUri : string ;
409- scope ?: string | string [ ] | undefined ;
409+ scope ?: string [ ] | undefined ;
410410 client : Client ;
411411 user : User ;
412412 codeChallenge ?: string ;
@@ -422,7 +422,7 @@ declare namespace OAuth2Server {
422422 accessTokenExpiresAt ?: Date | undefined ;
423423 refreshToken ?: string | undefined ;
424424 refreshTokenExpiresAt ?: Date | undefined ;
425- scope ?: string | string [ ] | undefined ;
425+ scope ?: string [ ] | undefined ;
426426 client : Client ;
427427 user : User ;
428428 [ key : string ] : any ;
@@ -434,7 +434,7 @@ declare namespace OAuth2Server {
434434 interface RefreshToken {
435435 refreshToken : string ;
436436 refreshTokenExpiresAt ?: Date | undefined ;
437- scope ?: string | string [ ] | undefined ;
437+ scope ?: string [ ] | undefined ;
438438 client : Client ;
439439 user : User ;
440440 [ key : string ] : any ;
0 commit comments