@auth/dynamodb-adapter 1.6.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/index.d.ts +5 -6
- package/index.d.ts.map +1 -1
- package/index.js +5 -6
- package/package.json +2 -2
- package/src/index.ts +5 -6
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<p align="center">
|
|
2
2
|
<br/>
|
|
3
3
|
<a href="https://authjs.dev" target="_blank">
|
|
4
|
-
<img height="64px" src="https://authjs.dev/img/logo
|
|
4
|
+
<img height="64px" src="https://authjs.dev/img/logo-sm.png" />
|
|
5
5
|
</a>
|
|
6
6
|
<a href="https://aws.amazon.com/dynamodb" target="_blank">
|
|
7
7
|
<img height="64px" src="https://authjs.dev/img/adapters/dynamodb.svg"/>
|
package/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* <div style={{display: "flex", justifyContent: "space-between", alignItems: "center", padding:
|
|
3
|
-
* <p style={{fontWeight: "
|
|
2
|
+
* <div style={{display: "flex", justifyContent: "space-between", alignItems: "center", padding: "16px"}}>
|
|
3
|
+
* <p style={{fontWeight: "300"}}>Official <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Introduction.html">DynamoDB</a> adapter for Auth.js / NextAuth.js.</p>
|
|
4
4
|
* <a href="https://docs.aws.amazon.com/dynamodb/index.html">
|
|
5
5
|
* <img style={{display: "block"}} src="https://authjs.dev/img/adapters/dynamodb.png" width="48"/>
|
|
6
6
|
* </a>
|
|
@@ -35,7 +35,7 @@ export interface DynamoDBAdapterOptions {
|
|
|
35
35
|
* You need to pass `DynamoDBDocument` client from the modular [`aws-sdk`](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/dynamodb-example-dynamodb-utilities.html) v3 to the adapter.
|
|
36
36
|
* The default table name is `next-auth`, but you can customise that by passing `{ tableName: 'your-table-name' }` as the second parameter in the adapter.
|
|
37
37
|
*
|
|
38
|
-
* ```
|
|
38
|
+
* ```js title="pages/api/auth/[...nextauth].js"
|
|
39
39
|
* import { DynamoDB, DynamoDBClientConfig } from "@aws-sdk/client-dynamodb"
|
|
40
40
|
* import { DynamoDBDocument } from "@aws-sdk/lib-dynamodb"
|
|
41
41
|
* import NextAuth from "next-auth";
|
|
@@ -74,7 +74,6 @@ export interface DynamoDBAdapterOptions {
|
|
|
74
74
|
* adapter: DynamoDBAdapter(
|
|
75
75
|
* client
|
|
76
76
|
* ),
|
|
77
|
-
* ...
|
|
78
77
|
* });
|
|
79
78
|
* ```
|
|
80
79
|
*
|
|
@@ -138,7 +137,7 @@ export interface DynamoDBAdapterOptions {
|
|
|
138
137
|
*
|
|
139
138
|
* You can create this table with infrastructure as code using [`aws-cdk`](https://github.com/aws/aws-cdk) with the following table definition:
|
|
140
139
|
*
|
|
141
|
-
* ```
|
|
140
|
+
* ```js title="stack.ts"
|
|
142
141
|
* new dynamodb.Table(this, `NextAuthTable`, {
|
|
143
142
|
* tableName: "next-auth",
|
|
144
143
|
* partitionKey: { name: "pk", type: dynamodb.AttributeType.STRING },
|
|
@@ -190,7 +189,7 @@ export interface DynamoDBAdapterOptions {
|
|
|
190
189
|
*
|
|
191
190
|
* You can configure your custom table schema by passing the `options` key to the adapter constructor:
|
|
192
191
|
*
|
|
193
|
-
* ```
|
|
192
|
+
* ```js
|
|
194
193
|
* const adapter = DynamoDBAdapter(client, {
|
|
195
194
|
* tableName: "custom-table-name",
|
|
196
195
|
* partitionKey: "custom-pk",
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAEV,gBAAgB,EACjB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EACV,OAAO,EAKR,MAAM,qBAAqB,CAAA;A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M,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG;IAC9D,gBAAgB,EAAE,MAAM,CAAA;IACxB,wBAAwB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAChD,yBAAyB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACnD,CAgBA;AAED,OAAO,EAAE,MAAM,EAAE,wBAAwB,EAAE,CAAA"}
|
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* <div style={{display: "flex", justifyContent: "space-between", alignItems: "center", padding:
|
|
3
|
-
* <p style={{fontWeight: "
|
|
2
|
+
* <div style={{display: "flex", justifyContent: "space-between", alignItems: "center", padding: "16px"}}>
|
|
3
|
+
* <p style={{fontWeight: "300"}}>Official <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Introduction.html">DynamoDB</a> adapter for Auth.js / NextAuth.js.</p>
|
|
4
4
|
* <a href="https://docs.aws.amazon.com/dynamodb/index.html">
|
|
5
5
|
* <img style={{display: "block"}} src="https://authjs.dev/img/adapters/dynamodb.png" width="48"/>
|
|
6
6
|
* </a>
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
* You need to pass `DynamoDBDocument` client from the modular [`aws-sdk`](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/dynamodb-example-dynamodb-utilities.html) v3 to the adapter.
|
|
26
26
|
* The default table name is `next-auth`, but you can customise that by passing `{ tableName: 'your-table-name' }` as the second parameter in the adapter.
|
|
27
27
|
*
|
|
28
|
-
* ```
|
|
28
|
+
* ```js title="pages/api/auth/[...nextauth].js"
|
|
29
29
|
* import { DynamoDB, DynamoDBClientConfig } from "@aws-sdk/client-dynamodb"
|
|
30
30
|
* import { DynamoDBDocument } from "@aws-sdk/lib-dynamodb"
|
|
31
31
|
* import NextAuth from "next-auth";
|
|
@@ -64,7 +64,6 @@
|
|
|
64
64
|
* adapter: DynamoDBAdapter(
|
|
65
65
|
* client
|
|
66
66
|
* ),
|
|
67
|
-
* ...
|
|
68
67
|
* });
|
|
69
68
|
* ```
|
|
70
69
|
*
|
|
@@ -128,7 +127,7 @@
|
|
|
128
127
|
*
|
|
129
128
|
* You can create this table with infrastructure as code using [`aws-cdk`](https://github.com/aws/aws-cdk) with the following table definition:
|
|
130
129
|
*
|
|
131
|
-
* ```
|
|
130
|
+
* ```js title="stack.ts"
|
|
132
131
|
* new dynamodb.Table(this, `NextAuthTable`, {
|
|
133
132
|
* tableName: "next-auth",
|
|
134
133
|
* partitionKey: { name: "pk", type: dynamodb.AttributeType.STRING },
|
|
@@ -180,7 +179,7 @@
|
|
|
180
179
|
*
|
|
181
180
|
* You can configure your custom table schema by passing the `options` key to the adapter constructor:
|
|
182
181
|
*
|
|
183
|
-
* ```
|
|
182
|
+
* ```js
|
|
184
183
|
* const adapter = DynamoDBAdapter(client, {
|
|
185
184
|
* tableName: "custom-table-name",
|
|
186
185
|
* partitionKey: "custom-pk",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@auth/dynamodb-adapter",
|
|
3
3
|
"repository": "https://github.com/nextauthjs/next-auth",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "2.0.0",
|
|
5
5
|
"description": "AWS DynamoDB adapter for next-auth.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"next-auth",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@aws-sdk/lib-dynamodb": "^3.36.1"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@auth/core": "0.
|
|
47
|
+
"@auth/core": "0.30.0"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"test:default": "vitest -c ../utils/vitest.config.ts",
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* <div style={{display: "flex", justifyContent: "space-between", alignItems: "center", padding:
|
|
3
|
-
* <p style={{fontWeight: "
|
|
2
|
+
* <div style={{display: "flex", justifyContent: "space-between", alignItems: "center", padding: "16px"}}>
|
|
3
|
+
* <p style={{fontWeight: "300"}}>Official <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Introduction.html">DynamoDB</a> adapter for Auth.js / NextAuth.js.</p>
|
|
4
4
|
* <a href="https://docs.aws.amazon.com/dynamodb/index.html">
|
|
5
5
|
* <img style={{display: "block"}} src="https://authjs.dev/img/adapters/dynamodb.png" width="48"/>
|
|
6
6
|
* </a>
|
|
@@ -47,7 +47,7 @@ export interface DynamoDBAdapterOptions {
|
|
|
47
47
|
* You need to pass `DynamoDBDocument` client from the modular [`aws-sdk`](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/dynamodb-example-dynamodb-utilities.html) v3 to the adapter.
|
|
48
48
|
* The default table name is `next-auth`, but you can customise that by passing `{ tableName: 'your-table-name' }` as the second parameter in the adapter.
|
|
49
49
|
*
|
|
50
|
-
* ```
|
|
50
|
+
* ```js title="pages/api/auth/[...nextauth].js"
|
|
51
51
|
* import { DynamoDB, DynamoDBClientConfig } from "@aws-sdk/client-dynamodb"
|
|
52
52
|
* import { DynamoDBDocument } from "@aws-sdk/lib-dynamodb"
|
|
53
53
|
* import NextAuth from "next-auth";
|
|
@@ -86,7 +86,6 @@ export interface DynamoDBAdapterOptions {
|
|
|
86
86
|
* adapter: DynamoDBAdapter(
|
|
87
87
|
* client
|
|
88
88
|
* ),
|
|
89
|
-
* ...
|
|
90
89
|
* });
|
|
91
90
|
* ```
|
|
92
91
|
*
|
|
@@ -150,7 +149,7 @@ export interface DynamoDBAdapterOptions {
|
|
|
150
149
|
*
|
|
151
150
|
* You can create this table with infrastructure as code using [`aws-cdk`](https://github.com/aws/aws-cdk) with the following table definition:
|
|
152
151
|
*
|
|
153
|
-
* ```
|
|
152
|
+
* ```js title="stack.ts"
|
|
154
153
|
* new dynamodb.Table(this, `NextAuthTable`, {
|
|
155
154
|
* tableName: "next-auth",
|
|
156
155
|
* partitionKey: { name: "pk", type: dynamodb.AttributeType.STRING },
|
|
@@ -202,7 +201,7 @@ export interface DynamoDBAdapterOptions {
|
|
|
202
201
|
*
|
|
203
202
|
* You can configure your custom table schema by passing the `options` key to the adapter constructor:
|
|
204
203
|
*
|
|
205
|
-
* ```
|
|
204
|
+
* ```js
|
|
206
205
|
* const adapter = DynamoDBAdapter(client, {
|
|
207
206
|
* tableName: "custom-table-name",
|
|
208
207
|
* partitionKey: "custom-pk",
|