@@ -104,14 +104,19 @@ export class AuthFlow {
104104 canisterId,
105105 session : get ( sessionStore ) ,
106106 } ) ;
107- await authenticationStore . set ( { identity, identityNumber } ) ;
107+ const authMethod = { passkey : { credentialId } } ;
108+ await authenticationStore . set ( {
109+ identity,
110+ identityNumber,
111+ authMethod,
112+ } ) ;
108113 const info =
109114 await get ( authenticatedStore ) . actor . get_anchor_info ( identityNumber ) ;
110115 if ( this . #options. trackLastUsed ) {
111116 lastUsedIdentitiesStore . addLastUsedIdentity ( {
112117 identityNumber,
113118 name : info . name [ 0 ] ,
114- authMethod : { passkey : { credentialId } } ,
119+ authMethod,
115120 createdAtMillis : info . created_at . map ( nanosToMillis ) [ 0 ] ,
116121 } ) ;
117122 }
@@ -200,7 +205,11 @@ export class AuthFlow {
200205 // If the call fails, it means the OpenID user does not exist in II.
201206 // In that case, we register them.
202207 authenticationV2Funnel . trigger ( AuthenticationV2Events . LoginWithOpenID ) ;
203- await authenticationStore . set ( { identity, identityNumber } ) ;
208+ await authenticationStore . set ( {
209+ identity,
210+ identityNumber,
211+ authMethod : { openid : { iss, sub } } ,
212+ } ) ;
204213 const info =
205214 await get ( authenticatedStore ) . actor . get_anchor_info ( identityNumber ) ;
206215 const authnMethod = info . openid_credentials [ 0 ] ?. find (
@@ -310,7 +319,11 @@ export class AuthFlow {
310319 const identity = await authenticateWithSession ( {
311320 session : get ( sessionStore ) ,
312321 } ) ;
313- await authenticationStore . set ( { identity, identityNumber } ) ;
322+ await authenticationStore . set ( {
323+ identity,
324+ identityNumber,
325+ authMethod : { passkey : { credentialId } } ,
326+ } ) ;
314327 if ( this . #options. trackLastUsed ) {
315328 lastUsedIdentitiesStore . addLastUsedIdentity ( {
316329 identityNumber,
@@ -403,7 +416,11 @@ export class AuthFlow {
403416 authenticationV2Funnel . trigger (
404417 AuthenticationV2Events . SuccessfulOpenIDRegistration ,
405418 ) ;
406- await authenticationStore . set ( { identity, identityNumber } ) ;
419+ await authenticationStore . set ( {
420+ identity,
421+ identityNumber,
422+ authMethod : { openid : { iss, sub } } ,
423+ } ) ;
407424 const metadata : MetadataMapV2 = [ ] ;
408425 if ( nonNullish ( jwtName ) ) {
409426 metadata . push ( [ "name" , { String : jwtName } ] ) ;
0 commit comments