[gitlab] Make sure the same ID is used when storing a target account (IDEA-346082)

#IDEA-346082 Fixed

Seems the account was not overridden because a new ID was generated for the
'updated' account, but it should still override the old account.

GitOrigin-RevId: 36a6dcc6118f0cd23b1d3e96af8282e6393cb884
This commit is contained in:
Chris Lemaire
2024-03-25 12:51:47 +00:00
committed by intellij-monorepo-bot
parent 9432be14aa
commit eaa66170a5
@@ -78,7 +78,10 @@ object GitLabLoginUtil {
val exitState = showLoginDialog(project, parentComponent, model, title, true)
val loginState = model.loginState.value
if (exitState == DialogWrapper.OK_EXIT_CODE && loginState is LoginModel.LoginState.Connected) {
return LoginResult.Success(GitLabAccount(name = loginState.username, server = model.getServerPath()), model.token)
return LoginResult.Success(
GitLabAccount(id = account.id, name = loginState.username, server = model.getServerPath()),
model.token
)
}
return LoginResult.Failure