-
Notifications
You must be signed in to change notification settings - Fork 40
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
What were you trying to achieve?
https://github.com/absmach/magistrala/blob/main/auth/jwt/tokenizer.go#L130
func toKey(tkn jwt.Token) (auth.Key, error) {
data, err := json.Marshal(tkn.PrivateClaims())
if err != nil {
return auth.Key{}, errors.Wrap(ErrJSONHandle, err)
}
var key auth.Key
if err := json.Unmarshal(data, &key); err != nil {
return auth.Key{}, errors.Wrap(ErrJSONHandle, err)
}
tType, ok := tkn.Get(tokenType)
if !ok {
return auth.Key{}, err // which the err is nil
}
What are the expected results?
define a new err like errInvalidToken
in https://github.com/absmach/magistrala/blob/main/auth/jwt/tokenizer.go#L19-L28
and return
What are the received results?
Steps To Reproduce
No response
In what environment did you encounter the issue?
Additional information you deem important
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working