Closed rgzr closed 7 months ago
Hey @rgzr. Thanks for raising this. We'll look into this and how we can handle the nil check the easiest way.
:tada: This issue has been resolved in version 3.11.2 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:
Preflight Checklist
Version
v3.11.1
Describe the problem caused by this bug
NewRelyingPartyOIDC
does not setunauthorizedHandler
field, so when an unauthorized error happens andunauthorizedError
function is called, it produces a panic here https://github.com/zitadel/oidc/blob/main/pkg/client/rp/relying_party.go#L755The check against
HasUnauthorizedHandler
interface passes becauserelyingParty
struct has a methodUnauthorizedHandler
that returns itsunauthorizedHandler
field (which can be nil).Maybe apart from checking against the interface, the function returned by the
UnauthorizedHandler
method should be checked against nil.To reproduce
Instantiate a
NewRelyingPartyOIDC
without additional options and force an unauthorized error.Screenshots
No response
Expected behavior
No response
Additional Context
No response