fix: don't error on invalid i18n tags in discovery

This changes the use of `[]language.Tag` to
`oidc.Locales` in `DiscoveryConfig`.
This should be compatible with callers that use
the `[]language.Tag` .

Locales now implements the `json.Unmarshaler` interface.
With support for json arrays or space seperated strings.
The latter because `UnmarshalText` might have been implicetely called
by the json library before we added UnmarshalJSON.

Fixes: #406
This commit is contained in:
Tim Möhlmann 2023-06-09 13:39:47 +02:00
parent 11c3ae3306
commit 7570c9dedb
4 changed files with 132 additions and 10 deletions

View file

@ -31,7 +31,7 @@ func TestDiscover(t *testing.T) {
wantFields: &wantFields{
UILocalesSupported: true,
},
wantErr: true,
wantErr: false,
},
}
for _, tt := range tests {