fix: role validation for given token (#55)

This commit is contained in:
Lakhan Samani 2021-10-09 09:40:45 +05:30 committed by GitHub
parent b1b7f47f4c
commit 5bd6fa5bc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)