Config UI: add provider auth subject to login errors (#25342)

This commit is contained in:
andig 2025-11-20 19:02:18 +01:00 • committed by GitHub
parent 5aadb01eae
commit 1f0bd92518
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 58 additions and 32 deletions

View file

@ -160,7 +160,7 @@ func (o *OAuth) Token() (*oauth2.Token, error) {
defer o.mu.Unlock()
if o.token == nil {
return nil, api.ErrMissingToken
return nil, api.LoginRequiredError(o.subject)
}
if o.token.Valid() {

View file

@ -21,7 +21,7 @@ func TestOAuth(t *testing.T) {
require.NoError(t, err)
token, err := ts.Token()
require.ErrorContains(t, err, "missing token credentials")
require.ErrorContains(t, err, "login required")
require.False(t, token.Valid())
require.Equal(t, 0, storerCalled)