next-auth-dynamodb
Advanced tools
Comparing version 0.1.4 to 0.1.5
@@ -113,3 +113,2 @@ "use strict"; | ||
providerType, | ||
refreshToken, | ||
accessToken, | ||
@@ -120,2 +119,5 @@ }; | ||
} | ||
if (refreshToken) { | ||
account.refreshToken = refreshToken; | ||
} | ||
await AccountStore.create(account); | ||
@@ -122,0 +124,0 @@ }, |
{ | ||
"name": "next-auth-dynamodb", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"contributors": [ | ||
@@ -5,0 +5,0 @@ "Tom Andrews <git@tomandrews.co.uk>" |
@@ -108,2 +108,32 @@ import Omanyd from "omanyd"; | ||
it("should not fail to link when there is no access refresh token", async () => { | ||
const adapter = await nextAuthDynamodb.getAdapter(opts); | ||
const savedUser = await adapter.createUser({ | ||
email: "foo@bar.com", | ||
emailVerified: false, | ||
name: "Foo Bar", | ||
image: "foo.png", | ||
}); | ||
const providerId = `providerId-${Date.now()}`; | ||
const providerAccountId = `providerAccountId-${Date.now()}`; | ||
await adapter.linkAccount( | ||
savedUser.id, | ||
providerId, | ||
"providerType", | ||
providerAccountId, | ||
undefined, | ||
"accessToken", | ||
Date.now() | ||
); | ||
const readUser = await adapter.getUserByProviderAccountId( | ||
providerId, | ||
providerAccountId | ||
); | ||
expect(readUser).toStrictEqual(savedUser); | ||
}); | ||
it("should not blow up if a provider uses numeric account ids", async () => { | ||
@@ -110,0 +140,0 @@ const adapter = await nextAuthDynamodb.getAdapter(opts); |
@@ -168,3 +168,2 @@ import type { Adapter } from "next-auth/adapters"; | ||
providerType, | ||
refreshToken, | ||
accessToken, | ||
@@ -175,2 +174,5 @@ }; | ||
} | ||
if (refreshToken) { | ||
account.refreshToken = refreshToken; | ||
} | ||
await AccountStore.create(account); | ||
@@ -177,0 +179,0 @@ }, |
28496
654