use strings instead of exp/slices
This commit is contained in:
parent
5c6ead281e
commit
45db180829
1 changed files with 3 additions and 3 deletions
|
@ -14,7 +14,7 @@ import (
|
||||||
|
|
||||||
httphelper "github.com/zitadel/oidc/v3/pkg/http"
|
httphelper "github.com/zitadel/oidc/v3/pkg/http"
|
||||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||||
"golang.org/x/exp/slices"
|
strs "github.com/zitadel/oidc/v3/pkg/strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DeviceAuthorizationConfig struct {
|
type DeviceAuthorizationConfig struct {
|
||||||
|
@ -265,7 +265,7 @@ func (r *DeviceAuthorizationState) GetAMR() []string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *DeviceAuthorizationState) GetAudience() []string {
|
func (r *DeviceAuthorizationState) GetAudience() []string {
|
||||||
if !slices.Contains(r.Audience, r.ClientID) {
|
if !strs.Contains(r.Audience, r.ClientID) {
|
||||||
r.Audience = append(r.Audience, r.ClientID)
|
r.Audience = append(r.Audience, r.ClientID)
|
||||||
}
|
}
|
||||||
return r.Audience
|
return r.Audience
|
||||||
|
@ -333,7 +333,7 @@ func CreateDeviceTokenResponse(ctx context.Context, tokenRequest TokenRequest, c
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(v4): remove type assertion
|
// TODO(v4): remove type assertion
|
||||||
if idTokenRequest, ok := tokenRequest.(IDTokenRequest); ok && slices.Contains(tokenRequest.GetScopes(), oidc.ScopeOpenID) {
|
if idTokenRequest, ok := tokenRequest.(IDTokenRequest); ok && strs.Contains(tokenRequest.GetScopes(), oidc.ScopeOpenID) {
|
||||||
response.IDToken, err = CreateIDToken(ctx, IssuerFromContext(ctx), idTokenRequest, client.IDTokenLifetime(), accessToken, "", creator.Storage(), client)
|
response.IDToken, err = CreateIDToken(ctx, IssuerFromContext(ctx), idTokenRequest, client.IDTokenLifetime(), accessToken, "", creator.Storage(), client)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue