Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

next-auth-dynamodb

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

next-auth-dynamodb - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

11

lib/index.js

@@ -34,3 +34,3 @@ "use strict";

accessToken: joi_1.default.string().required(),
accessTokenExpires: joi_1.default.number().required(),
accessTokenExpires: joi_1.default.number(),
},

@@ -109,3 +109,3 @@ });

});
await AccountStore.create({
const account = {
userId,

@@ -117,4 +117,7 @@ providerId,

accessToken,
accessTokenExpires,
});
};
if (accessTokenExpires) {
account.accessTokenExpires = accessTokenExpires;
}
await AccountStore.create(account);
},

@@ -121,0 +124,0 @@ // Session

{
"name": "next-auth-dynamodb",
"version": "0.1.3",
"version": "0.1.4",
"contributors": [

@@ -5,0 +5,0 @@ "Tom Andrews <git@tomandrews.co.uk>"

@@ -78,2 +78,32 @@ import Omanyd from "omanyd";

it("should not fail to link when there is no access token expiry date", 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,
"refreshToken",
"accessToken",
null
);
const readUser = await adapter.getUserByProviderAccountId(
providerId,
providerAccountId
);
expect(readUser).toStrictEqual(savedUser);
});
it("should not blow up if a provider uses numeric account ids", async () => {

@@ -80,0 +110,0 @@ const adapter = await nextAuthDynamodb.getAdapter(opts);

@@ -37,3 +37,3 @@ import type { Adapter } from "next-auth/adapters";

accessToken: string;
accessTokenExpires: number;
accessTokenExpires?: number;
}

@@ -52,3 +52,3 @@

accessToken: Joi.string().required(),
accessTokenExpires: Joi.number().required(),
accessTokenExpires: Joi.number(),
},

@@ -154,3 +154,3 @@ });

accessToken: string,
accessTokenExpires: number
accessTokenExpires: number | null
) {

@@ -166,3 +166,3 @@ log("linkAccount", {

});
await AccountStore.create({
const account: Omit<Account, "id"> = {
userId,

@@ -174,4 +174,7 @@ providerId,

accessToken,
accessTokenExpires,
});
};
if (accessTokenExpires) {
account.accessTokenExpires = accessTokenExpires;
}
await AccountStore.create(account);
},

@@ -178,0 +181,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc