nextauthjs / nextauthjs/next-auth

neo4j adapter + strava provider error

Open
#4,528 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

adapters neo4j triage
Dominant language
TypeScript
Stars
28.4k
Forks
4k
PR merge metrics
No merged PRs in 30d

Description

Adapter type

@next-auth/neo4j-adapter

Environment

System:
OS: macOS 11.6
CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
Memory: 427.27 MB / 8.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.15.0 - /usr/local/bin/node
Yarn: 1.17.3 - /usr/local/bin/yarn
npm: 8.5.5 - /usr/local/bin/npm
Browsers:
Chrome: 101.0.4951.54
Firefox: 76.0.1
Safari: 14.1.2
npmPackages:
next: 12.1.5 => 12.1.5
next-auth: ^4.3.4 => 4.3.4
react: 18.1.0 => 18.1.0

Reproduction URL

https://github.com/m1stermanager/strava-neo-bug

Describe the issue

whenever using the neo4j adapter w/ the strava provider, the following error is thrown:

Property values can only be of primitive types or arrays thereof. Encountered: Map{country -> String("United States"), <additional properties from my personal strava profile>\n +
'\n' +
' at captureStacktrace (/Users///src/node_modules/neo4j-driver-core/lib/result.js:239:17)\n' +
' at new Result (/Users///src/node_modules/neo4j-driver-core/lib/result.js:59:23)\n' +
' at newCompletedResult (/Users///src/node_modules/neo4j-driver-core/lib/transaction.js:433:12)\n' +
' at Object.run (/Users///src/node_modules/neo4j-driver-core/lib/transaction.js:287:20)\n' +
' at Transaction.run (/Users///src/node_modules/neo4j-driver-core/lib/transaction.js:137:34)\n' +
' at /Users///src/node_modules/@next-auth/neo4j-adapter/dist/utils.js:60:70\n' +
' at TransactionExecutor._safeExecuteTransactionWork (/Users///src/node_modules/neo4j-driver-core/lib/internal/transaction-executor.js:92:26)\n' +
' at TransactionExecutor._executeTransactionInsidePromise (/Users///src/node_modules/neo4j-driver-core/lib/internal/transaction-executor.js:83:34)\n' +
' at /Users///src/node_modules/neo4j-driver-core/lib/internal/transaction-executor.js:40:19\n' +
' at new Promise ()',
name: 'Neo4jError'

How to reproduce

use the strava provider w/ the neo4j adapter

Expected behavior

provider and adapter would be expected to work such that appropriate nodes are created in DB

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reproduction URL and the Neo4j adapter call shown at node_modules/@next-auth/neo4j-adapter/dist/utils.js:60. Reproduce the Strava sign-in, inspect which profile value becomes a Neo4j Map, and confirm the fix when the provider and adapter create the expected database nodes without the primitive-property error.

Written by the indexing model from the issue text.

Assessment

Tech stack
neo4j, next.js, node.js
Domain
authentication, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.