next-auth-dynamodb
Advanced tools
Comparing version 0.3.2 to 0.3.3
@@ -169,3 +169,3 @@ "use strict"; | ||
}; | ||
exports.getAccount = async (userId, providerId) => { | ||
const getAccount = async (userId, providerId) => { | ||
const account = await AccountStore.getByIndex("AccountsUserIdIndex", userId); | ||
@@ -177,3 +177,4 @@ if ((account === null || account === void 0 ? void 0 : account.providerId) !== providerId) { | ||
}; | ||
exports.seedSession = async (details) => { | ||
exports.getAccount = getAccount; | ||
const seedSession = async (details) => { | ||
await omanyd_1.default.createTables(); | ||
@@ -192,2 +193,3 @@ const a = await adapter.getAdapter({}); | ||
}; | ||
exports.seedSession = seedSession; | ||
exports.default = adapter; |
{ | ||
"name": "next-auth-dynamodb", | ||
"version": "0.3.2", | ||
"version": "0.3.3", | ||
"contributors": [ | ||
@@ -29,19 +29,19 @@ "Tom Andrews <git@tomandrews.co.uk>" | ||
"omanyd": "^0.4.2", | ||
"pino": "^6.7.0" | ||
"pino": "^6.9.0" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^26.0.10", | ||
"@types/next-auth": "^3.1.12", | ||
"@types/node": "^14.6.2", | ||
"@types/pino": "^6.3.2", | ||
"@types/jest": "^26.0.19", | ||
"@types/next-auth": "^3.1.19", | ||
"@types/node": "^14.14.18", | ||
"@types/pino": "^6.3.4", | ||
"@types/uuid": "^8.3.0", | ||
"husky": "^4.2.5", | ||
"jest": "^26.4.2", | ||
"lint-staged": "^10.2.13", | ||
"np": "^6.5.0", | ||
"prettier": "^2.1.1", | ||
"ts-jest": "^26.3.0", | ||
"ts-node": "^9.0.0", | ||
"typescript": "^4.0.2", | ||
"wait-on": "^5.2.0" | ||
"husky": "^4.3.6", | ||
"jest": "^26.6.3", | ||
"lint-staged": "^10.5.3", | ||
"np": "^7.2.0", | ||
"prettier": "^2.2.1", | ||
"ts-jest": "^26.4.4", | ||
"ts-node": "^9.1.1", | ||
"typescript": "^4.1.3", | ||
"wait-on": "^5.2.1" | ||
}, | ||
@@ -48,0 +48,0 @@ "husky": { |
@@ -9,2 +9,6 @@ # next-auth-dynamodb | ||
- Saving and retrieving of sessions from dynamodb | ||
- Seeding of sessions for tests | ||
- Retrieving of full linked provider information for a user | ||
## Debugging | ||
@@ -15,2 +19,33 @@ | ||
### Example config | ||
To use `next-auth-dynamodb` you need to provide it as an adapter in the `next-auth` config. | ||
Here is an example config for use with GitHub login. | ||
```ts | ||
import { NextApiRequest, NextApiResponse } from "next"; | ||
import NextAuth, { InitOptions } from "next-auth"; | ||
import Providers from "next-auth/providers"; | ||
import NextAuthDynamodb from "next-auth-dynamodb"; | ||
const options: InitOptions = { | ||
debug: Boolean(process.env.NEXT_AUTH_DEBUG), | ||
providers: [ | ||
Providers.GitHub({ | ||
clientId: process.env.GITHUB_CLIENT_ID!, | ||
clientSecret: process.env.GITHUB_CLIENT_SECRET!, | ||
scope: "user", | ||
}), | ||
], | ||
adapter: NextAuthDynamodb, | ||
session: { | ||
jwt: false, | ||
}, | ||
}; | ||
export default (req: NextApiRequest, res: NextApiResponse) => | ||
NextAuth(req, res, options); | ||
``` | ||
## Support | ||
@@ -17,0 +52,0 @@ |
39540
936
55
Updatedpino@^6.9.0