next-auth-dynamodb
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -6,3 +6,3 @@ import type { Adapter } from "next-auth/adapters"; | ||
name: string; | ||
email: string; | ||
email?: string; | ||
image: string; | ||
@@ -9,0 +9,0 @@ emailVerified?: boolean; |
@@ -17,3 +17,3 @@ "use strict"; | ||
id: omanyd_1.default.types.id(), | ||
email: joi_1.default.string().required(), | ||
email: joi_1.default.string(), | ||
name: joi_1.default.string(), | ||
@@ -63,3 +63,3 @@ image: joi_1.default.string(), | ||
const savedUser = await UserStore.create({ | ||
email, | ||
email: email ? email : undefined, | ||
emailVerified, | ||
@@ -66,0 +66,0 @@ name, |
{ | ||
"name": "next-auth-dynamodb", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"contributors": [ | ||
@@ -5,0 +5,0 @@ "Tom Andrews <git@tomandrews.co.uk>" |
@@ -54,2 +54,13 @@ import Omanyd from "omanyd"; | ||
it("should not blow up if the user's email address is null", async () => { | ||
const adapter = await nextAuthDynamodb.getAdapter(opts); | ||
const savedUser = await adapter.createUser({ | ||
email: null, | ||
name: "Null Email", | ||
image: "foo.png", | ||
}); | ||
const readUser = await adapter.getUser(savedUser.id); | ||
expect(readUser).toStrictEqual(savedUser); | ||
}); | ||
it("should be able to link a user to the a provider and return the user", async () => { | ||
@@ -56,0 +67,0 @@ const adapter = await nextAuthDynamodb.getAdapter(opts); |
@@ -12,3 +12,3 @@ import type { Adapter } from "next-auth/adapters"; | ||
name: string; | ||
email: string; | ||
email?: string; | ||
image: string; | ||
@@ -23,3 +23,3 @@ emailVerified?: boolean; | ||
id: Omanyd.types.id(), | ||
email: Joi.string().required(), | ||
email: Joi.string(), | ||
name: Joi.string(), | ||
@@ -62,3 +62,3 @@ image: Joi.string(), | ||
name: string; | ||
email: string; | ||
email: string | null; | ||
image: string; | ||
@@ -104,3 +104,3 @@ emailVerified?: boolean; | ||
const savedUser = await UserStore.create({ | ||
email, | ||
email: email ? email : undefined, | ||
emailVerified, | ||
@@ -107,0 +107,0 @@ name, |
38538
934