Fix postgres provider grant queries

This commit is contained in:
IanShaw027
2026-04-21 09:52:12 -07:00
parent dcbddef611
commit 9bf8ab7048
2 changed files with 2 additions and 2 deletions

View File

@@ -61,7 +61,7 @@ func (s *AuthService) applyProviderDefaultSettingsOnFirstBind(
if err := client.Driver().Exec( if err := client.Driver().Exec(
ctx, ctx,
`INSERT INTO user_provider_default_grants (user_id, provider_type, grant_reason) `INSERT INTO user_provider_default_grants (user_id, provider_type, grant_reason)
VALUES (?, ?, ?) VALUES ($1, $2, $3)
ON CONFLICT (user_id, provider_type, grant_reason) DO NOTHING`, ON CONFLICT (user_id, provider_type, grant_reason) DO NOTHING`,
[]any{userID, strings.TrimSpace(providerType), "first_bind"}, []any{userID, strings.TrimSpace(providerType), "first_bind"},
&result, &result,

View File

@@ -855,7 +855,7 @@ func (s *AuthService) hasProviderGrantRecord(
rows, err := s.entClient.QueryContext( rows, err := s.entClient.QueryContext(
ctx, ctx,
`SELECT 1 FROM user_provider_default_grants WHERE user_id = ? AND provider_type = ? AND grant_reason = ? LIMIT 1`, `SELECT 1 FROM user_provider_default_grants WHERE user_id = $1 AND provider_type = $2 AND grant_reason = $3 LIMIT 1`,
userID, userID,
strings.TrimSpace(providerType), strings.TrimSpace(providerType),
strings.TrimSpace(grantReason), strings.TrimSpace(grantReason),