Improves the invite mechanism for remote clusters (#31025)
Co-authored-by: Miguel de la Cruz <miguel@ctrlz.es>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
e51ea025db
Коммит
fbf105f6ef
@@ -69,6 +69,11 @@ func (rcs *Service) ReceiveInviteConfirmation(confirm model.RemoteClusterInvite)
|
||||
rc.SiteURL = confirm.SiteURL
|
||||
rc.RemoteToken = confirm.Token
|
||||
|
||||
// If the accepting cluster sent a RefreshedToken (its RemoteToken), set it as our Token
|
||||
if confirm.Version >= 2 && confirm.RefreshedToken != "" {
|
||||
rc.Token = confirm.RefreshedToken
|
||||
}
|
||||
|
||||
rcUpdated, err := store.Update(rc)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot apply invite confirmation for remote %s: %w", confirm.RemoteId, err)
|
||||
|
||||
Ссылка в новой задаче
Block a user