fix: role validation for given token (#55)
This commit is contained in:
parent
b1b7f47f4c
commit
5bd6fa5bc9
|
@ -36,8 +36,8 @@ func Token(ctx context.Context, role *string) (*model.AuthResponse, error) {
|
||||||
return res, err
|
return res, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if role != nil && role != &claimRole {
|
if role != nil && *role != claimRole {
|
||||||
return res, fmt.Errorf(`unauthorized. invalid role for a given token`)
|
return res, fmt.Errorf(`unauthorized`)
|
||||||
}
|
}
|
||||||
|
|
||||||
userIdStr := fmt.Sprintf("%v", user.ID)
|
userIdStr := fmt.Sprintf("%v", user.ID)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user