11'use strict' ;
22
33const test = require ( 'ava' ) ;
4- const { PasswordOwner } = require ( '../index' ) ;
4+ const { ResourceOwnerPassword } = require ( '../index' ) ;
55const AccessToken = require ( '../lib/access-token' ) ;
66const { createModuleConfig } = require ( './_module-config' ) ;
77const {
@@ -36,7 +36,7 @@ test.serial('@getToken => resolves to an access token (body credentials and JSON
3636 password : 'secret' ,
3737 } ;
3838
39- const oauth2 = new PasswordOwner ( config ) ;
39+ const oauth2 = new ResourceOwnerPassword ( config ) ;
4040 const accessToken = await oauth2 . getToken ( tokenParams ) ;
4141
4242 scope . done ( ) ;
@@ -68,7 +68,7 @@ test.serial('@getToken => resolves to an access token (body credentials and form
6868 password : 'secret' ,
6969 } ;
7070
71- const oauth2 = new PasswordOwner ( config ) ;
71+ const oauth2 = new ResourceOwnerPassword ( config ) ;
7272 const accessToken = await oauth2 . getToken ( tokenParams ) ;
7373
7474 scope . done ( ) ;
@@ -97,7 +97,7 @@ test.serial('@getToken => resolves to an access token (header credentials)', asy
9797 password : 'secret' ,
9898 } ;
9999
100- const oauth2 = new PasswordOwner ( config ) ;
100+ const oauth2 = new ResourceOwnerPassword ( config ) ;
101101 const accessToken = await oauth2 . getToken ( tokenParams ) ;
102102
103103 scope . done ( ) ;
@@ -136,7 +136,7 @@ test.serial('@getToken => resolves to an access token with custom module configu
136136 password : 'secret' ,
137137 } ;
138138
139- const oauth2 = new PasswordOwner ( config ) ;
139+ const oauth2 = new ResourceOwnerPassword ( config ) ;
140140 const accessToken = await oauth2 . getToken ( tokenParams ) ;
141141
142142 scope . done ( ) ;
@@ -175,7 +175,7 @@ test.serial('@getToken => resolves to an access token with custom module configu
175175 password : 'secret' ,
176176 } ;
177177
178- const oauth2 = new PasswordOwner ( config ) ;
178+ const oauth2 = new ResourceOwnerPassword ( config ) ;
179179 const accessToken = await oauth2 . getToken ( tokenParams ) ;
180180
181181 scope . done ( ) ;
@@ -205,7 +205,7 @@ test.serial('@getToken => resolves to an access token with custom module configu
205205 password : 'secret' ,
206206 } ;
207207
208- const oauth2 = new PasswordOwner ( config ) ;
208+ const oauth2 = new ResourceOwnerPassword ( config ) ;
209209 const accessToken = await oauth2 . getToken ( tokenParams ) ;
210210
211211 scope . done ( ) ;
@@ -243,7 +243,7 @@ test.serial('@getToken => resolves to an access token with custom module configu
243243 password : 'secret' ,
244244 } ;
245245
246- const oauth2 = new PasswordOwner ( config ) ;
246+ const oauth2 = new ResourceOwnerPassword ( config ) ;
247247 const accessToken = await oauth2 . getToken ( tokenParams ) ;
248248
249249 scope . done ( ) ;
@@ -274,7 +274,7 @@ test.serial('@getToken => resolves to an access token with custom module configu
274274 } ,
275275 } ) ;
276276
277- const oauth2 = new PasswordOwner ( config ) ;
277+ const oauth2 = new ResourceOwnerPassword ( config ) ;
278278
279279 const accessToken = await oauth2 . getToken ( tokenParams ) ;
280280
@@ -301,7 +301,7 @@ test.serial('@getToken => resolves to an access token while following redirectio
301301 } ;
302302
303303 const config = createModuleConfig ( ) ;
304- const oauth2 = new PasswordOwner ( config ) ;
304+ const oauth2 = new ResourceOwnerPassword ( config ) ;
305305
306306 const accessToken = await oauth2 . getToken ( tokenParams ) ;
307307
@@ -330,7 +330,7 @@ test.serial('@getToken => resolves to an access token while requesting multiple
330330 } ;
331331
332332 const config = createModuleConfig ( ) ;
333- const oauth2 = new PasswordOwner ( config ) ;
333+ const oauth2 = new ResourceOwnerPassword ( config ) ;
334334
335335 const accessToken = await oauth2 . getToken ( tokenParams ) ;
336336
@@ -356,7 +356,7 @@ test.serial('@getToken => resolves to an access token with a custom grant type',
356356 } ;
357357
358358 const config = createModuleConfig ( ) ;
359- const oauth2 = new PasswordOwner ( config ) ;
359+ const oauth2 = new ResourceOwnerPassword ( config ) ;
360360
361361 const accessToken = await oauth2 . getToken ( tokenParams ) ;
362362
@@ -374,7 +374,7 @@ test.serial('@getToken => resolves to an access token with no params', async (t)
374374 const scope = server . tokenSuccess ( scopeOptions , tokenRequestParams ) ;
375375
376376 const config = createModuleConfig ( ) ;
377- const oauth2 = new PasswordOwner ( config ) ;
377+ const oauth2 = new ResourceOwnerPassword ( config ) ;
378378
379379 const accessToken = await oauth2 . getToken ( ) ;
380380
@@ -397,7 +397,7 @@ test.serial('@getToken => resolves to an access token with custom (inline) http
397397 const scope = server . tokenSuccess ( scopeOptions , tokenRequestParams ) ;
398398
399399 const config = createModuleConfig ( ) ;
400- const oauth2 = new PasswordOwner ( config ) ;
400+ const oauth2 = new ResourceOwnerPassword ( config ) ;
401401
402402 const httpOptions = {
403403 headers : {
@@ -421,7 +421,7 @@ test.serial('@getToken => resolves to an access token with custom (inline) http
421421 const scope = server . tokenSuccess ( scopeOptions , tokenRequestParams ) ;
422422
423423 const config = createModuleConfig ( ) ;
424- const oauth2 = new PasswordOwner ( config ) ;
424+ const oauth2 = new ResourceOwnerPassword ( config ) ;
425425
426426 const httpOptions = {
427427 headers : {
@@ -460,7 +460,7 @@ test.serial('@getToken => rejects the operation when a non json response is rece
460460 password : 'secret' ,
461461 } ;
462462
463- const oauth2 = new PasswordOwner ( config ) ;
463+ const oauth2 = new ResourceOwnerPassword ( config ) ;
464464 const error = await t . throwsAsync ( ( ) => oauth2 . getToken ( tokenParams ) ) ;
465465
466466 scope . done ( ) ;
0 commit comments