From 7be038e742a010f4532a9cb1072a1ec95ce158f1 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 2 Dec 2020 07:59:29 -0500 Subject: [PATCH] Make authorization errors more specific --- server/directives.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/directives.go b/server/directives.go index 9afef56489321c873d97f140a179ea41d11451c8..5aa9488b77113caf413cb2bb02ff524deddc3bd8 100644 --- a/server/directives.go +++ b/server/directives.go @@ -13,7 +13,7 @@ func Internal(ctx context.Context, obj interface{}, next graphql.Resolver) (interface{}, error) { if auth.ForContext(ctx).AuthMethod != auth.AUTH_INTERNAL { - return nil, fmt.Errorf("Access denied") + return nil, fmt.Errorf("Internal auth access denied") } return next(ctx) @@ -47,5 +47,5 @@ func Access(ctx context.Context, obj interface{}, next graphql.Resolver, panic(fmt.Errorf("Unknown auth method for access check")) } - return nil, fmt.Errorf("Access denied") + return nil, fmt.Errorf("Access denied for invalid auth method") }