@auth/azure-tables-adapter 1.0.0 → 1.2.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 +1 -41
- package/index.d.ts.map +1 -1
- package/index.js +1 -41
- package/package.json +2 -2
- package/src/index.ts +2 -41
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
<img src="https://img.shields.io/npm/dm/@auth/azure-tables-adapter?label=%20downloads&style=flat-square" alt="Downloads" />
|
|
19
19
|
</a>
|
|
20
20
|
<a href="https://github.com/nextauthjs/next-auth/stargazers">
|
|
21
|
-
<img src="https://img.shields.io/github/stars/nextauthjs/next-auth?style=flat-square" alt="
|
|
21
|
+
<img src="https://img.shields.io/github/stars/nextauthjs/next-auth?style=flat-square" alt="GitHub Stars" />
|
|
22
22
|
</a>
|
|
23
23
|
</p>
|
|
24
24
|
</p>
|
package/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* <div style={{display: "flex", justifyContent: "space-between", alignItems: "center", padding: "16px"}}>
|
|
3
|
-
* <p
|
|
3
|
+
* <p>An official <a href="https://azure.microsoft.com/en-us/products/storage/tables">Azure Table Storage</a> adapter for Auth.js / NextAuth.js.</p>
|
|
4
4
|
* <a href="https://azure.microsoft.com/en-us/products/storage/tables">
|
|
5
5
|
* <img style={{display: "block"}} src="/img/adapters/azure-tables.svg" width="48" />
|
|
6
6
|
* </a>
|
|
@@ -26,45 +26,5 @@ export declare const keys: {
|
|
|
26
26
|
verificationToken: string;
|
|
27
27
|
};
|
|
28
28
|
export declare function withoutKeys<T>(entity: GetTableEntityResponse<TableEntityResult<T>>): T;
|
|
29
|
-
/**
|
|
30
|
-
*
|
|
31
|
-
* 1. Create a table for authentication data, `auth` in the example below.
|
|
32
|
-
*
|
|
33
|
-
* ```js title="auth.ts"
|
|
34
|
-
* import type { AuthConfig } from "next-auth"
|
|
35
|
-
* import { TableStorageAdapter } from "@next-auth/azure-tables-adapter"
|
|
36
|
-
* import { AzureNamedKeyCredential, TableClient } from "@azure/data-tables"
|
|
37
|
-
*
|
|
38
|
-
* const credential = new AzureNamedKeyCredential(
|
|
39
|
-
* process.env.AZURE_ACCOUNT,
|
|
40
|
-
* process.env.AZURE_ACCESS_KEY
|
|
41
|
-
* )
|
|
42
|
-
* const authClient = new TableClient(
|
|
43
|
-
* process.env.AZURE_TABLES_ENDPOINT,
|
|
44
|
-
* "auth",
|
|
45
|
-
* credential
|
|
46
|
-
* )
|
|
47
|
-
*
|
|
48
|
-
* // For more information on each option (and a full list of options) go to
|
|
49
|
-
* // https://authjs.dev/reference/core/types#authconfig
|
|
50
|
-
* export default const authConfig = {
|
|
51
|
-
* // https://authjs.dev/getting-started/authentication/oauth
|
|
52
|
-
* providers: [
|
|
53
|
-
* // ...
|
|
54
|
-
* ],
|
|
55
|
-
* adapter: TableStorageAdapter(authClient),
|
|
56
|
-
* // ...
|
|
57
|
-
* } satisfies AuthConfig
|
|
58
|
-
* ```
|
|
59
|
-
*
|
|
60
|
-
* Environment variable are as follows:
|
|
61
|
-
*
|
|
62
|
-
* ```
|
|
63
|
-
* AZURE_ACCOUNT=storageaccountname
|
|
64
|
-
* AZURE_ACCESS_KEY=longRandomKey
|
|
65
|
-
* AZURE_TABLES_ENDPOINT=https://$AZURE_ACCOUNT.table.core.windows.net
|
|
66
|
-
* ```
|
|
67
|
-
*
|
|
68
|
-
*/
|
|
69
29
|
export declare const TableStorageAdapter: (client: TableClient) => Adapter;
|
|
70
30
|
//# sourceMappingURL=index.d.ts.map
|
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,EACV,OAAO,EAKR,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,sBAAsB,EACtB,WAAW,EACX,iBAAiB,EAClB,MAAM,oBAAoB,CAAA;AAE3B,eAAO,MAAM,IAAI;;;;;;;;CAQhB,CAAA;AAED,wBAAgB,WAAW,CAAC,CAAC,EAC3B,MAAM,EAAE,sBAAsB,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,GACnD,CAAC,CAUH;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EACV,OAAO,EAKR,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,sBAAsB,EACtB,WAAW,EACX,iBAAiB,EAClB,MAAM,oBAAoB,CAAA;AAE3B,eAAO,MAAM,IAAI;;;;;;;;CAQhB,CAAA;AAED,wBAAgB,WAAW,CAAC,CAAC,EAC3B,MAAM,EAAE,sBAAsB,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,GACnD,CAAC,CAUH;AAED,eAAO,MAAM,mBAAmB,WAAY,WAAW,KAAG,OA+MzD,CAAA"}
|
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* <div style={{display: "flex", justifyContent: "space-between", alignItems: "center", padding: "16px"}}>
|
|
3
|
-
* <p
|
|
3
|
+
* <p>An official <a href="https://azure.microsoft.com/en-us/products/storage/tables">Azure Table Storage</a> adapter for Auth.js / NextAuth.js.</p>
|
|
4
4
|
* <a href="https://azure.microsoft.com/en-us/products/storage/tables">
|
|
5
5
|
* <img style={{display: "block"}} src="/img/adapters/azure-tables.svg" width="48" />
|
|
6
6
|
* </a>
|
|
@@ -33,46 +33,6 @@ export function withoutKeys(entity) {
|
|
|
33
33
|
delete entity["odata.metadata"];
|
|
34
34
|
return entity;
|
|
35
35
|
}
|
|
36
|
-
/**
|
|
37
|
-
*
|
|
38
|
-
* 1. Create a table for authentication data, `auth` in the example below.
|
|
39
|
-
*
|
|
40
|
-
* ```js title="auth.ts"
|
|
41
|
-
* import type { AuthConfig } from "next-auth"
|
|
42
|
-
* import { TableStorageAdapter } from "@next-auth/azure-tables-adapter"
|
|
43
|
-
* import { AzureNamedKeyCredential, TableClient } from "@azure/data-tables"
|
|
44
|
-
*
|
|
45
|
-
* const credential = new AzureNamedKeyCredential(
|
|
46
|
-
* process.env.AZURE_ACCOUNT,
|
|
47
|
-
* process.env.AZURE_ACCESS_KEY
|
|
48
|
-
* )
|
|
49
|
-
* const authClient = new TableClient(
|
|
50
|
-
* process.env.AZURE_TABLES_ENDPOINT,
|
|
51
|
-
* "auth",
|
|
52
|
-
* credential
|
|
53
|
-
* )
|
|
54
|
-
*
|
|
55
|
-
* // For more information on each option (and a full list of options) go to
|
|
56
|
-
* // https://authjs.dev/reference/core/types#authconfig
|
|
57
|
-
* export default const authConfig = {
|
|
58
|
-
* // https://authjs.dev/getting-started/authentication/oauth
|
|
59
|
-
* providers: [
|
|
60
|
-
* // ...
|
|
61
|
-
* ],
|
|
62
|
-
* adapter: TableStorageAdapter(authClient),
|
|
63
|
-
* // ...
|
|
64
|
-
* } satisfies AuthConfig
|
|
65
|
-
* ```
|
|
66
|
-
*
|
|
67
|
-
* Environment variable are as follows:
|
|
68
|
-
*
|
|
69
|
-
* ```
|
|
70
|
-
* AZURE_ACCOUNT=storageaccountname
|
|
71
|
-
* AZURE_ACCESS_KEY=longRandomKey
|
|
72
|
-
* AZURE_TABLES_ENDPOINT=https://$AZURE_ACCOUNT.table.core.windows.net
|
|
73
|
-
* ```
|
|
74
|
-
*
|
|
75
|
-
*/
|
|
76
36
|
export const TableStorageAdapter = (client) => {
|
|
77
37
|
return {
|
|
78
38
|
async createUser(user) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@auth/azure-tables-adapter",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Azure Tables Storage adapter for next-auth.",
|
|
5
5
|
"homepage": "https://authjs.dev",
|
|
6
6
|
"repository": "https://github.com/nextauthjs/next-auth",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@auth/core": "0.
|
|
40
|
+
"@auth/core": "0.32.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"@azure/data-tables": "^13.2.1"
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* <div style={{display: "flex", justifyContent: "space-between", alignItems: "center", padding: "16px"}}>
|
|
3
|
-
* <p
|
|
3
|
+
* <p>An official <a href="https://azure.microsoft.com/en-us/products/storage/tables">Azure Table Storage</a> adapter for Auth.js / NextAuth.js.</p>
|
|
4
4
|
* <a href="https://azure.microsoft.com/en-us/products/storage/tables">
|
|
5
5
|
* <img style={{display: "block"}} src="/img/adapters/azure-tables.svg" width="48" />
|
|
6
6
|
* </a>
|
|
@@ -51,46 +51,7 @@ export function withoutKeys<T>(
|
|
|
51
51
|
|
|
52
52
|
return entity
|
|
53
53
|
}
|
|
54
|
-
|
|
55
|
-
*
|
|
56
|
-
* 1. Create a table for authentication data, `auth` in the example below.
|
|
57
|
-
*
|
|
58
|
-
* ```js title="auth.ts"
|
|
59
|
-
* import type { AuthConfig } from "next-auth"
|
|
60
|
-
* import { TableStorageAdapter } from "@next-auth/azure-tables-adapter"
|
|
61
|
-
* import { AzureNamedKeyCredential, TableClient } from "@azure/data-tables"
|
|
62
|
-
*
|
|
63
|
-
* const credential = new AzureNamedKeyCredential(
|
|
64
|
-
* process.env.AZURE_ACCOUNT,
|
|
65
|
-
* process.env.AZURE_ACCESS_KEY
|
|
66
|
-
* )
|
|
67
|
-
* const authClient = new TableClient(
|
|
68
|
-
* process.env.AZURE_TABLES_ENDPOINT,
|
|
69
|
-
* "auth",
|
|
70
|
-
* credential
|
|
71
|
-
* )
|
|
72
|
-
*
|
|
73
|
-
* // For more information on each option (and a full list of options) go to
|
|
74
|
-
* // https://authjs.dev/reference/core/types#authconfig
|
|
75
|
-
* export default const authConfig = {
|
|
76
|
-
* // https://authjs.dev/getting-started/authentication/oauth
|
|
77
|
-
* providers: [
|
|
78
|
-
* // ...
|
|
79
|
-
* ],
|
|
80
|
-
* adapter: TableStorageAdapter(authClient),
|
|
81
|
-
* // ...
|
|
82
|
-
* } satisfies AuthConfig
|
|
83
|
-
* ```
|
|
84
|
-
*
|
|
85
|
-
* Environment variable are as follows:
|
|
86
|
-
*
|
|
87
|
-
* ```
|
|
88
|
-
* AZURE_ACCOUNT=storageaccountname
|
|
89
|
-
* AZURE_ACCESS_KEY=longRandomKey
|
|
90
|
-
* AZURE_TABLES_ENDPOINT=https://$AZURE_ACCOUNT.table.core.windows.net
|
|
91
|
-
* ```
|
|
92
|
-
*
|
|
93
|
-
*/
|
|
54
|
+
|
|
94
55
|
export const TableStorageAdapter = (client: TableClient): Adapter => {
|
|
95
56
|
return {
|
|
96
57
|
async createUser(user) {
|