Skip to content

Commit

Permalink
Merge pull request #80 from LonglyCode/patch-1
Browse files Browse the repository at this point in the history
store check result exists reverse
  • Loading branch information
LyricTian authored Jun 13, 2020
2 parents cbeec2d + 4bb1a18 commit 7d8ac09
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkg/auth/jwtauth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,9 @@ func (a *JWTAuth) ParseUserID(ctx context.Context, tokenString string) (string,
}

err = a.callStore(func(store Storer) error {
exists, err := store.Check(ctx, tokenString)
if err != nil {
if exists, err := store.Check(ctx, tokenString); err != nil {
return err
} else if exists {
} else if !exists {
return auth.ErrInvalidToken
}
return nil
Expand Down

0 comments on commit 7d8ac09

Please sign in to comment.