fix(op): return state in token response only for implicit flow (#460)

* fix(op): return state in token response only for implicit flow

* oops
This commit is contained in:
Tim Möhlmann 2023-10-13 15:17:03 +03:00 committed by GitHub
parent 976b40620c
commit 0dc2a6e7a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -51,8 +51,11 @@ func CreateTokenResponse(ctx context.Context, request IDTokenRequest, client Cli
if err != nil {
return nil, err
}
// only implicit flow requires state to be returned.
if code == "" {
state = authRequest.GetState()
}
}
exp := uint64(validity.Seconds())
return &oidc.AccessTokenResponse{