From 2dfcb74601ff657aef33b1f78cad9c8df5477674 Mon Sep 17 00:00:00 2001 From: nyagamunene Date: Wed, 8 Jan 2025 13:31:40 +0300 Subject: [PATCH] fix retrieve pat method Signed-off-by: nyagamunene --- auth/service.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/auth/service.go b/auth/service.go index 579d8466fd..bf31a40850 100644 --- a/auth/service.go +++ b/auth/service.go @@ -514,13 +514,8 @@ func (svc service) UpdatePATDescription(ctx context.Context, token, patID, descr return pat, nil } -func (svc service) RetrievePAT(ctx context.Context, token, patID string) (PAT, error) { - key, err := svc.Identify(ctx, token) - if err != nil { - return PAT{}, err - } - - pat, err := svc.pats.Retrieve(ctx, key.User, patID) +func (svc service) RetrievePAT(ctx context.Context, userID, patID string) (PAT, error) { + pat, err := svc.pats.Retrieve(ctx, userID, patID) if err != nil { return PAT{}, errors.Wrap(errRetrievePAT, err) }