Skip to content

Commit 213b935

Browse files
committed
make success and error pages immutable, isolate changes from user application
1 parent 6436b38 commit 213b935

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

apps/public/public.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,8 +543,11 @@ func WithSystemBrowserOptions(successPage []byte, errorPage []byte) interface {
543543
func(a any) error {
544544
switch t := a.(type) {
545545
case *interactiveAuthOptions:
546-
t.successPage = successPage
547-
t.errorPage = errorPage
546+
t.successPage = make([]byte, len(successPage))
547+
copy(t.successPage, successPage)
548+
549+
t.errorPage = make([]byte, len(errorPage))
550+
copy(t.errorPage, errorPage)
548551
default:
549552
return fmt.Errorf("unexpected options type %T", a)
550553
}

0 commit comments

Comments
 (0)