diff --git a/src/Speckle.Sdk/Credentials/AccountManager.cs b/src/Speckle.Sdk/Credentials/AccountManager.cs index 2009ebbf..720df8d0 100644 --- a/src/Speckle.Sdk/Credentials/AccountManager.cs +++ b/src/Speckle.Sdk/Credentials/AccountManager.cs @@ -399,8 +399,9 @@ public sealed class AccountManager( /// /// Refetches user and server info for each account /// + /// It is defaultAppId in the server. By default it is "sca" to not break existing parts that this function involves. /// - public async Task UpdateAccounts(CancellationToken ct = default) + public async Task UpdateAccounts(CancellationToken ct = default, string app = "sca") { // need to ToList() the GetAccounts call or the UpdateObject call at the end of this method // will not work because sqlite does not support concurrent db calls @@ -415,7 +416,7 @@ public sealed class AccountManager( //TODO: once we get a token expired exception from the server use that instead if (userServerInfo?.activeUser == null || userServerInfo.serverInfo == null) { - var tokenResponse = await GetRefreshedToken(account.refreshToken, url).ConfigureAwait(false); + var tokenResponse = await GetRefreshedToken(account.refreshToken, url, app).ConfigureAwait(false); userServerInfo = await GetUserServerInfo(tokenResponse.token, url, ct).ConfigureAwait(false); if (userServerInfo?.activeUser == null || userServerInfo.serverInfo == null) @@ -766,7 +767,7 @@ public sealed class AccountManager( } } - private async Task GetRefreshedToken(string refreshToken, Uri server) + private async Task GetRefreshedToken(string refreshToken, Uri server, string app = "sca") { try { @@ -774,8 +775,8 @@ public sealed class AccountManager( var body = new { - appId = "sca", - appSecret = "sca", + appId = app, + appSecret = app, refreshToken, };