chore: format surrealdb deps

This commit is contained in:
Thang Vu
2023-09-24 09:45:44 +07:00
parent bec01a82ea
commit a96dcdbca3
3 changed files with 7 additions and 15 deletions

View File

@@ -1,5 +1,5 @@
{
"name": "@next-auth/surrealdb-adapter",
"name": "@auth/surrealdb-adapter",
"version": "0.0.0",
"description": "SurrealDB adapter for next-auth.",
"homepage": "https://authjs.dev",
@@ -48,11 +48,9 @@
"surrealdb.js": "^0.9.0"
},
"devDependencies": {
"@types/node-fetch": "^2.5.11",
"@auth/adapter-test": "workspace:*",
"@auth/tsconfig": "workspace:*",
"jest": "^27.4.3",
"node-fetch": "^2.6.1"
"jest": "^27.4.3"
},
"jest": {
"preset": "@auth/adapter-test/jest"

View File

@@ -1,5 +1,4 @@
import Surreal, { ExperimentalSurrealHTTP } from "surrealdb.js"
import fetch from "node-fetch"
import {
SurrealDBAdapter,
@@ -25,9 +24,8 @@ export const config = (
user: `user:${id}`,
})
const user = users[0]
if (user.result?.[0] !== undefined)
return docToUser(user.result[0])
} catch (e) { }
if (user.result?.[0] !== undefined) return docToUser(user.result[0])
} catch (e) {}
return null
},
async account({ provider, providerAccountId }) {
@@ -55,7 +53,9 @@ export const config = (
},
async verificationToken({ identifier, token }) {
const surreal = await clientPromise
const tokens = await surreal.query<[{ identifier: string, expires: string, token: string, id: string }[]]>(
const tokens = await surreal.query<
[{ identifier: string; expires: string; token: string; id: string }[]]
>(
`SELECT *
FROM verification_token
WHERE identifier = $identifier

6
pnpm-lock.yaml generated
View File

@@ -724,15 +724,9 @@ importers:
'@auth/tsconfig':
specifier: workspace:*
version: link:../tsconfig
'@types/node-fetch':
specifier: ^2.5.11
version: 2.6.2
jest:
specifier: ^27.4.3
version: 27.5.1
node-fetch:
specifier: ^2.6.1
version: 2.6.9
packages/adapter-test:
devDependencies: