Skip to content

Commit 1c855dd

Browse files
committed
fix imports on etsy auth provider
1 parent 1cc3991 commit 1c855dd

File tree

1 file changed

+15
-10
lines changed
  • src/server/auth/custom-providers

1 file changed

+15
-10
lines changed

src/server/auth/custom-providers/etsy.ts

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import { env } from "@/env";
2-
import type { OAuth2Config, OAuthUserConfig } from "@auth/core/providers";
32
import { db } from "@/server/db";
43

4+
import type { OAuth2Config, OAuthUserConfig } from "next-auth/providers";
5+
56
export interface EtsyProfile {
6-
user_id: number; // The numeric ID of a user. Also a valid shop ID.
7-
primary_email?: string | null; // The user's primary email address (nullable).
8-
first_name?: string | null; // The user's first name (nullable).
9-
last_name?: string | null; // The user's last name (nullable).
10-
image_url_75x75?: string | null; // The user's avatar URL (nullable).
7+
user_id: number;
8+
primary_email?: string | null;
9+
first_name?: string | null;
10+
last_name?: string | null;
11+
image_url_75x75?: string | null;
1112
}
1213

1314
export default function EtsyProvider<P extends EtsyProfile>(
@@ -48,9 +49,7 @@ export default function EtsyProvider<P extends EtsyProfile>(
4849
},
4950
);
5051

51-
const user = (await response.json()) as EtsyProfile;
52-
53-
return user;
52+
return (await response.json()) as EtsyProfile;
5453
},
5554
},
5655
profile(profile) {
@@ -81,7 +80,13 @@ export async function refreshEtsyAccessToken(
8180
if (!response.ok) {
8281
throw new Error("Failed to refresh Etsy access token");
8382
}
84-
const tokens = await response.json();
83+
const tokens = (await response.json()) as {
84+
access_token: string;
85+
refresh_token: string;
86+
scope: string;
87+
token_type: string;
88+
expires_at: number;
89+
};
8590

8691
await db.account.update({
8792
where: {

0 commit comments

Comments
 (0)