Skip to content

Commit

Permalink
remove mongoNoDocs check
Browse files Browse the repository at this point in the history
  • Loading branch information
jr22 committed Sep 24, 2024
1 parent 76ad87e commit 69c93fe
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions web/sessions.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,7 @@ func (mss *mongoDBSessionStore) HasSessionWithToken(ctx context.Context, token s

count, err := mss.collection.CountDocuments(ctx, bson.M{accessTokenFieldPath: token}, options.Count().SetLimit(1))
if err != nil {
if errors.Is(err, mongo.ErrNoDocuments) {
return false, errNoSession
}
return false, fmt.Errorf("failed to load session from db: %w", err)
return false, fmt.Errorf("failed to check if token session exists: %w", err)
}

return count > 0, nil
Expand Down

0 comments on commit 69c93fe

Please sign in to comment.