NOISSUE - Fix refreshKey method (#3472)
Continuous Delivery / lint-and-build (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Property Based Tests / api-test (push) Has been cancelled

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
This commit is contained in:
Steve Munene
2026-04-15 14:30:00 +03:00
committed by GitHub
parent 3541ea8678
commit ac8dadefc6
8 changed files with 29 additions and 15 deletions
+2 -1
View File
@@ -7,6 +7,7 @@ import (
"context"
grpcAuthV1 "github.com/absmach/magistrala/api/grpc/auth/v1"
mgauth "github.com/absmach/magistrala/auth"
"github.com/absmach/magistrala/auth/api/grpc/auth"
"github.com/absmach/magistrala/pkg/authn"
"github.com/absmach/magistrala/pkg/errors"
@@ -43,7 +44,7 @@ func (a authentication) Authenticate(ctx context.Context, token string) (authn.S
return authn.Session{}, errors.Wrap(errors.ErrAuthentication, err)
}
if res.GetId() != "" {
if res.GetTokenType() == uint32(mgauth.PersonalAccessToken) {
return authn.Session{Type: authn.PersonalAccessToken, PatID: res.GetId(), UserID: res.GetUserId(), Role: authn.Role(res.GetUserRole())}, nil
}