From e9093138fa6f516e89a58fbfabfb64be8c6cfdec Mon Sep 17 00:00:00 2001 From: Eric Gullickson <16152721+ericgullickson@users.noreply.github.com> Date: Mon, 16 Feb 2026 11:50:26 -0600 Subject: [PATCH] fix: replace remaining auth0_sub references with UUID identity (refs #220) Vehicles service and subscriptions code still queried user_profiles by auth0_sub after the UUID migration, causing 500 errors on GET /api/vehicles. Co-Authored-By: Claude Opus 4.6 --- .../features/subscriptions/domain/subscriptions.service.ts | 4 ++-- backend/src/features/subscriptions/jobs/grace-period.job.ts | 6 +++--- backend/src/features/vehicles/domain/vehicles.service.ts | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/backend/src/features/subscriptions/domain/subscriptions.service.ts b/backend/src/features/subscriptions/domain/subscriptions.service.ts index 9e5fffe..9a31bbe 100644 --- a/backend/src/features/subscriptions/domain/subscriptions.service.ts +++ b/backend/src/features/subscriptions/domain/subscriptions.service.ts @@ -767,7 +767,7 @@ export class SubscriptionsService { ): Promise { try { // Get user profile for email and name - const userProfile = await this.userProfileRepository.getByAuth0Sub(userId); + const userProfile = await this.userProfileRepository.getById(userId); if (!userProfile) { logger.warn('User profile not found for tier change notification', { userId }); return; @@ -925,7 +925,7 @@ export class SubscriptionsService { // Sync tier to user_profiles table (within same transaction) await client.query( - 'UPDATE user_profiles SET subscription_tier = $1 WHERE auth0_sub = $2', + 'UPDATE user_profiles SET subscription_tier = $1 WHERE id = $2', [newTier, userId] ); diff --git a/backend/src/features/subscriptions/jobs/grace-period.job.ts b/backend/src/features/subscriptions/jobs/grace-period.job.ts index 60ce022..f4345b5 100644 --- a/backend/src/features/subscriptions/jobs/grace-period.job.ts +++ b/backend/src/features/subscriptions/jobs/grace-period.job.ts @@ -50,7 +50,7 @@ export async function processGracePeriodExpirations(): Promise> { // Get user's subscription tier - const userProfile = await this.userProfileRepository.getByAuth0Sub(userId); + const userProfile = await this.userProfileRepository.getById(userId); if (!userProfile) { throw new Error('User profile not found'); }