From f30c5492b305fbc163e70a4e85bdd051963fad71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20M=C3=B6hlmann?= Date: Thu, 1 Aug 2024 13:41:34 +0300 Subject: [PATCH] update godoc --- pkg/oidc/error.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/oidc/error.go b/pkg/oidc/error.go index c609f8e..1100f73 100644 --- a/pkg/oidc/error.go +++ b/pkg/oidc/error.go @@ -184,6 +184,13 @@ func (e *Error) WithParent(err error) *Error { return e } +// WithReturnParentToClient allows returning the set parent error to the HTTP client. +// Currently it only supports setting the parent inside JSON responses, not redirect URLs. +// As Go errors don't unmarshal well, only the marshaller is implemented for the moment. +// +// Warning: parent errors may contain sensitive data or unwanted details about the server status. +// Also, the `parent` field is not a standard error field and might confuse certain clients +// that require fully compliant responses. func (e *Error) WithReturnParentToClient(b bool) *Error { e.returnParent = b return e