Show missing OAuth scopes after connector reconnect

Partial grants completed without feedback, leaving Reconnect
required unexplained. Keep the token and toast the backend
missing-scopes error after the OAuth callback redirect.

Signed-off-by: Sacha Al Himdani <sacha@probo.com>
This commit is contained in:
Sacha Al Himdani
2026-07-31 15:32:45 +02:00
parent 65a3186d68
commit e8e5e9bf9d
6 changed files with 255 additions and 43 deletions

View File

@@ -98,3 +98,19 @@ func TestCampaignClientErrors(t *testing.T) {
})
}
}
func TestMissingOAuthScopesError(t *testing.T) {
t.Parallel()
err := accessreview.NewMissingOAuthScopesError([]string{
"https://graph.microsoft.com/AuditLog.Read.All",
"openid",
})
assert.Equal(
t,
"Missing required OAuth scopes: AuditLog.Read.All, openid",
err.Error(),
)
assert.ErrorIs(t, err, accessreview.ErrMissingOAuthScopes)
}