Skip to content

Commit c42e9ea

Browse files
committed
Refactor using different function name WithSystemBrowserOptions to set error and success pages
1 parent fbdd760 commit c42e9ea

File tree

1 file changed

+1
-22
lines changed

1 file changed

+1
-22
lines changed

apps/public/public.go

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ type AcquireInteractiveOption interface {
531531
acquireInteractiveOption()
532532
}
533533

534-
func WithSuccessPage(successPage []byte) interface {
534+
func WithSystemBrowserOptions(successPage []byte, errorPage []byte) interface {
535535
AcquireInteractiveOption
536536
options.CallOption
537537
} {
@@ -544,27 +544,6 @@ func WithSuccessPage(successPage []byte) interface {
544544
switch t := a.(type) {
545545
case *interactiveAuthOptions:
546546
t.successPage = successPage
547-
default:
548-
return fmt.Errorf("unexpected options type %T", a)
549-
}
550-
return nil
551-
},
552-
),
553-
}
554-
}
555-
556-
func WithErrorPage(errorPage []byte) interface {
557-
AcquireInteractiveOption
558-
options.CallOption
559-
} {
560-
return struct {
561-
AcquireInteractiveOption
562-
options.CallOption
563-
}{
564-
CallOption: options.NewCallOption(
565-
func(a any) error {
566-
switch t := a.(type) {
567-
case *interactiveAuthOptions:
568547
t.errorPage = errorPage
569548
default:
570549
return fmt.Errorf("unexpected options type %T", a)

0 commit comments

Comments
 (0)