File tree Expand file tree Collapse file tree 2 files changed +40
-1
lines changed
src/routes/(new-styling)/(resuming-channel)/resume-openid-authorize
tests/e2e-playwright/authorize Expand file tree Collapse file tree 2 files changed +40
-1
lines changed Original file line number Diff line number Diff line change 5353 const implicitConsentAttributeKeys = paramsResult .data .attributes .filter (
5454 (attribute ) =>
5555 attribute === ` openid:${issuer }:name ` ||
56- attribute === ` openid:${issuer }:email ` ,
56+ attribute === ` openid:${issuer }:email ` ||
57+ attribute === ` openid:${issuer }:verified_email ` ,
5758 );
5859 try {
5960 const { attributes, issued_at_timestamp_ns } =
Original file line number Diff line number Diff line change @@ -143,4 +143,42 @@ test.describe("Authorize with direct OpenID", () => {
143143 await signInWithOpenId ( authorizePage . page , openIdUsers [ 0 ] . id ) ;
144144 } ) ;
145145 } ) ;
146+
147+ test . describe ( "with verified_email attribute" , ( ) => {
148+ const email = "john.doe@example.com" ;
149+
150+ test . use ( {
151+ openIdConfig : {
152+ defaultPort : DEFAULT_OPENID_PORT ,
153+ createUsers : [
154+ {
155+ claims : { email, email_verified : "true" } ,
156+ } ,
157+ ] ,
158+ } ,
159+ authorizeConfig : {
160+ protocol : "icrc25" ,
161+ openid : `http://localhost:${ DEFAULT_OPENID_PORT } ` ,
162+ attributes : [
163+ `openid:http://localhost:${ DEFAULT_OPENID_PORT } :verified_email` ,
164+ ] ,
165+ } ,
166+ } ) ;
167+
168+ test . afterEach ( ( { authorizedPrincipal, authorizedAttributes } ) => {
169+ expect ( authorizedPrincipal ?. isAnonymous ( ) ) . toBe ( false ) ;
170+ expect ( authorizedAttributes ) . toEqual ( {
171+ [ `openid:http://localhost:${ DEFAULT_OPENID_PORT } :verified_email` ] :
172+ email ,
173+ } ) ;
174+ } ) ;
175+
176+ test ( "should return verified email" , async ( {
177+ authorizePage,
178+ signInWithOpenId,
179+ openIdUsers,
180+ } ) => {
181+ await signInWithOpenId ( authorizePage . page , openIdUsers [ 0 ] . id ) ;
182+ } ) ;
183+ } ) ;
146184} ) ;
You can’t perform that action at this time.
0 commit comments