@@ -133,7 +133,7 @@ describe('features.ciba', () => {
133133 const route = '/backchannel' ;
134134
135135 it ( 'minimal w/ login_hint' , async function ( ) {
136- const [ , [ , request , account , client ] ] = await Promise . all ( [
136+ const [ , [ , request , account , client ] , verifyUserCode ] = await Promise . all ( [
137137 this . agent . post ( route )
138138 . send ( {
139139 scope : 'openid' ,
@@ -166,6 +166,7 @@ describe('features.ciba', () => {
166166 expect ( request . params ) . to . deep . eql ( {
167167 client_id : 'client' , login_hint : 'accountId' , scope : 'openid' , extra2 : 'defaulted' , extra : 'provided' ,
168168 } ) ;
169+ expect ( verifyUserCode [ 2 ] ) . to . be . undefined ;
169170 } ) ;
170171
171172 it ( 'does not require PAR for clients with require_pushed_authorization_requests' , async function ( ) {
@@ -183,6 +184,24 @@ describe('features.ciba', () => {
183184 } ) ;
184185 } ) ;
185186
187+ it ( 'passes user_code to verifyUserCode' , async function ( ) {
188+ const [ , verifyUserCode ] = await Promise . all ( [
189+ this . agent . post ( route )
190+ . send ( {
191+ scope : 'openid' ,
192+ login_hint : 'accountId' ,
193+ user_code : '1234' ,
194+ client_id : 'client-user-code' ,
195+ } )
196+ . type ( 'form' )
197+ . expect ( 200 )
198+ . expect ( 'content-type' , / a p p l i c a t i o n \/ j s o n / ) ,
199+ once ( emitter , 'verifyUserCode' ) ,
200+ ] ) ;
201+
202+ expect ( verifyUserCode [ 2 ] ) . to . equal ( '1234' ) ;
203+ } ) ;
204+
186205 it ( 'requested_expiry' , async function ( ) {
187206 await this . agent . post ( route )
188207 . send ( {
0 commit comments