@next-auth/dgraph-adapter
Advanced tools
Comparing version 0.2.2-pr.317-adf65e69.308 to 0.2.2-pr.317-bfdb755d.317
@@ -6,2 +6,3 @@ export interface DgraphClientParams { | ||
jwtSecret?: string; | ||
jwtAlgorithm?: "HS256" | "RS256"; | ||
authHeader?: string; | ||
@@ -8,0 +9,0 @@ } |
@@ -43,3 +43,3 @@ "use strict"; | ||
} | ||
const { endpoint, authToken, jwtSecret, authHeader } = params; | ||
const { endpoint, authToken, jwtSecret, jwtAlgorithm = "HS256", authHeader = "Authorization", } = params; | ||
const headers = { | ||
@@ -51,3 +51,3 @@ "Content-Type": "application/json", | ||
headers[authHeader] = jwt.sign({ nextAuth: true }, jwtSecret, { | ||
algorithm: "HS256", | ||
algorithm: jwtAlgorithm, | ||
}); | ||
@@ -54,0 +54,0 @@ } |
import { format } from "./utils"; | ||
import type { Adapter } from "next-auth/adapters"; | ||
import type { DgraphClientParams } from "./client"; | ||
export type { DgraphClientParams, DgraphClientError } from "./client"; | ||
export interface DgraphAdapterOptions { | ||
@@ -12,4 +13,3 @@ fragments?: { | ||
} | ||
export type { DgraphClientParams }; | ||
export { format }; | ||
export declare function DgraphAdapter(client: DgraphClientParams, options?: DgraphAdapterOptions): Adapter; |
@@ -195,3 +195,2 @@ "use strict"; | ||
const { userId, ...input } = data; | ||
console.log(input); | ||
await c.run( | ||
@@ -198,0 +197,0 @@ /* GraphQL */ ` |
{ | ||
"name": "@next-auth/dgraph-adapter", | ||
"version": "0.2.2-pr.317-adf65e69.308+adf65e6", | ||
"version": "0.2.2-pr.317-bfdb755d.317+bfdb755", | ||
"description": "Dgraph adapter for next-auth.", | ||
@@ -47,3 +47,3 @@ "homepage": "https://next-auth.js.org", | ||
}, | ||
"gitHead": "adf65e69ea5c7cf950f494fd95e35f34b20357f3" | ||
"gitHead": "bfdb755d195fa5833fc2abfffad4a1605a61e661" | ||
} |
@@ -36,14 +36,4 @@ <p align="center"> | ||
import NextAuth from "next-auth" | ||
import { DgraphClient, DgraphAdapter } from "@next-auth/dgraph-adapter/dgraphAdapter"; | ||
import { DgraphAdapter } from "@next-auth/dgraph-adapter"; | ||
const dgraph = new DgraphClient({ | ||
endpoint: process.env.DGRAPH_GRAPHQL_ENDPOINT, | ||
apiKey: process.env.DGRAPH_GRAPHQL_KEY, | ||
// you can omit the following properties if you are running an unsecure schema | ||
authHeader: "<YOUR AUTH HEADER>", | ||
jwtSecret: process.env.SECRET | ||
}); | ||
// For more information on each option (and a full list of options) go to | ||
@@ -56,3 +46,10 @@ // https://next-auth.js.org/configuration/options | ||
], | ||
adapter: DgraphAdapter(dgraph) | ||
adapter: DgraphAdapter({ | ||
endpoint: process.env.DGRAPH_GRAPHQL_ENDPOINT, | ||
authToken: process.env.DGRAPH_GRAPHQL_KEY, | ||
// you can omit the following properties if you are running an unsecure schema | ||
authHeader: "<YOUR AUTH HEADER>", | ||
jwtSecret: process.env.SECRET | ||
}) | ||
... | ||
@@ -59,0 +56,0 @@ }) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
22738
158