Skip to content

Commit 5bd6fa5

Browse files
authored
fix: role validation for given token (#55)
1 parent b1b7f47 commit 5bd6fa5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/resolvers/token.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ func Token(ctx context.Context, role *string) (*model.AuthResponse, error) {
3636
return res, err
3737
}
3838

39-
if role != nil && role != &claimRole {
40-
return res, fmt.Errorf(`unauthorized. invalid role for a given token`)
39+
if role != nil && *role != claimRole {
40+
return res, fmt.Errorf(`unauthorized`)
4141
}
4242

4343
userIdStr := fmt.Sprintf("%v", user.ID)

0 commit comments

Comments
 (0)