refactor(db): use new store interface (#831)

This commit is contained in:
Scott McKendry
2026-05-19 07:33:09 +12:00
committed by GitHub
parent 8b4ba23328
commit a56c349525
52 changed files with 1849 additions and 123 deletions
+3 -4
View File
@@ -2,7 +2,6 @@ package service
import (
"context"
"database/sql"
"errors"
"fmt"
"net/http"
@@ -79,7 +78,7 @@ type AuthService struct {
context context.Context
ldap *LdapService
queries *repository.Queries
queries repository.Store
oauthBroker *OAuthBrokerService
loginAttempts map[string]*LoginAttempt
@@ -100,7 +99,7 @@ func NewAuthService(
ctx context.Context,
wg *sync.WaitGroup,
ldap *LdapService,
queries *repository.Queries,
queries repository.Store,
oauthBroker *OAuthBrokerService,
) *AuthService {
service := &AuthService{
@@ -417,7 +416,7 @@ func (auth *AuthService) GetSession(ctx context.Context, uuid string) (*reposito
session, err := auth.queries.GetSession(ctx, uuid)
if err != nil {
if errors.Is(err, sql.ErrNoRows) {
if errors.Is(err, repository.ErrNotFound) {
return nil, errors.New("session not found")
}
return nil, err