Skip to content

Commit 570f3e9

Browse files
committed
fix: bypass autumn if node env development
1 parent 7cc2f1f commit 570f3e9

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

packages/auth/src/auth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,6 @@ export const websitesApi = {
277277
};
278278

279279
export type User = (typeof auth)['$Infer']['Session']['user'] & {
280-
role?: 'owner' | 'admin' | 'member' | 'viewer';
280+
role?: 'OWNER' | 'ADMIN' | 'MEMBER' | 'VIEWER';
281281
};
282282
export type Session = (typeof auth)['$Infer']['Session'];

packages/rpc/src/utils/billing.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ import { Autumn } from 'autumn-js';
55

66
const autumn = new Autumn();
77

8+
const isDevelopment = process.env.NODE_ENV === 'development';
9+
810
export async function checkAndTrackWebsiteCreation(customerId: string) {
11+
if (isDevelopment) {
12+
return { allowed: true };
13+
}
14+
915
if (!customerId) {
1016
return { allowed: true };
1117
}
@@ -30,6 +36,10 @@ export async function checkAndTrackWebsiteCreation(customerId: string) {
3036
}
3137

3238
export async function trackWebsiteUsage(customerId: string, value: number) {
39+
if (isDevelopment) {
40+
return { success: true };
41+
}
42+
3343
if (!customerId) {
3444
return { success: false };
3545
}

0 commit comments

Comments
 (0)