Skip to content

Commit

Permalink
update token type to use auth.KeyType constants
Browse files Browse the repository at this point in the history
Signed-off-by: Rodney Osodo <[email protected]>
  • Loading branch information
rodneyosodo committed Mar 14, 2024
1 parent 0e8a8dd commit 24ee2c5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions users/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func (svc service) IssueToken(ctx context.Context, identity, secret, domainID st
if domainID != "" {
d = domainID
}
return svc.auth.Issue(ctx, &magistrala.IssueReq{UserId: dbUser.ID, DomainId: &d, Type: 0})
return svc.auth.Issue(ctx, &magistrala.IssueReq{UserId: dbUser.ID, DomainId: &d, Type: uint32(auth.AccessKey)})
}

func (svc service) RefreshToken(ctx context.Context, refreshToken, domainID string) (*magistrala.Token, error) {
Expand Down Expand Up @@ -587,7 +587,7 @@ func (svc service) OAuthCallback(ctx context.Context, state mgoauth2.State, clie
}
claims := &magistrala.IssueReq{
UserId: rclient.ID,
Type: 0,
Type: uint32(auth.AccessKey),
}
return svc.auth.Issue(ctx, claims)
case mgoauth2.SignUp:
Expand All @@ -600,7 +600,7 @@ func (svc service) OAuthCallback(ctx context.Context, state mgoauth2.State, clie
}
claims := &magistrala.IssueReq{
UserId: rclient.ID,
Type: 0,
Type: uint32(auth.AccessKey),
}
return svc.auth.Issue(ctx, claims)
default:
Expand Down

0 comments on commit 24ee2c5

Please sign in to comment.