@@ -130,7 +130,7 @@ const seedlessOnboardingMetadata: StateMetadata<SeedlessOnboardingControllerStat
130
130
// stays outside of vault as this token is accessed by the metadata service
131
131
// before the vault is created or unlocked.
132
132
metadataAccessToken : {
133
- persist : false ,
133
+ persist : true ,
134
134
anonymous : true ,
135
135
} ,
136
136
encryptedSeedlessEncryptionKey : {
@@ -229,22 +229,22 @@ export class SeedlessOnboardingController<EncryptionKey> extends BaseController<
229
229
* @param params.socialLoginEmail - The user email from Social login.
230
230
* @param params.refreshToken - refresh token for refreshing expired nodeAuthTokens.
231
231
* @param params.revokeToken - revoke token for revoking refresh token and get new refresh token and new revoke token.
232
- * @param params.accessToken - access token for pairing with profile sync auth service and to access other services.
233
- * @param params.metadataAccessToken - metadata access token for accessing the metadata service before the vault is created or unlocked.
232
+ * @param params.accessToken - Access token for pairing with profile sync auth service and to access other services.
233
+ * @param params.metadataAccessToken - Metadata access token for accessing the metadata service before the vault is created or unlocked.
234
234
* @param params.skipLock - Optional flag to skip acquiring the controller lock. (to prevent deadlock in case the caller already acquired the lock)
235
235
* @returns A promise that resolves to the authentication result.
236
236
*/
237
237
async authenticate ( params : {
238
238
idTokens : string [ ] ;
239
+ accessToken : string ;
240
+ metadataAccessToken : string ;
239
241
authConnection : AuthConnection ;
240
242
authConnectionId : string ;
241
243
userId : string ;
242
244
groupedAuthConnectionId ?: string ;
243
245
socialLoginEmail ?: string ;
244
246
refreshToken ?: string ;
245
247
revokeToken ?: string ;
246
- accessToken ?: string ;
247
- metadataAccessToken ?: string ;
248
248
skipLock ?: boolean ;
249
249
} ) {
250
250
const doAuthenticateWithNodes = async ( ) => {
@@ -1677,10 +1677,12 @@ export class SeedlessOnboardingController<EncryptionKey> extends BaseController<
1677
1677
connection : this . state . authConnection ,
1678
1678
refreshToken,
1679
1679
} ) ;
1680
- const { idTokens } = res ;
1680
+ const { idTokens, accessToken , metadataAccessToken } = res ;
1681
1681
// re-authenticate with the new id tokens to set new node auth tokens
1682
1682
await this . authenticate ( {
1683
1683
idTokens,
1684
+ accessToken,
1685
+ metadataAccessToken,
1684
1686
authConnection : this . state . authConnection ,
1685
1687
authConnectionId : this . state . authConnectionId ,
1686
1688
groupedAuthConnectionId : this . state . groupedAuthConnectionId ,
0 commit comments