Skip to content

Empty update in auth drivers thows an error, preventing login #127

Description

@florisdipt

Describe the Bug

I plan to make a PR to replicate the fix for: directus/directus#18595
Since I am encountering it when having google as my only Oauth provider.

Which is:
https://github.com/directus/directus/pull/18607/files

A quick search on this repo yields this result:
https://github.com/search?q=repo%3ALaWebcapsule%2Fdirectus9%20auth_data%3A%20userPayload.auth_data&type=code

Making me think that this fix was never applied here.
Let me know if i oversaw anything.

Here is some off my logs for those interested:

[18:00:37.955] WARN: [OpenID] Unexpected error during OpenID login
    err: {
      "type": "Error",
      "message": "Empty .update() call detected! Update data does not contain any values to update. This will result in a faulty query. Table: directus_users. Columns: auth_data.",
      "stack":
          Error: Empty .update() call detected! Update data does not contain any values to update. This will result in a faulty query. Table: directus_users. Columns: auth_data.
              at QueryCompiler_MySQL._prepUpdate (/node_modules/knex/lib/query/querycompiler.js:1365:13)
              at QueryCompiler_MySQL.update (/node_modules/knex/lib/dialects/mysql/query/mysql-querycompiler.js:108:26)
              at QueryCompiler_MySQL.toSQL (/node_modules/knex/lib/query/querycompiler.js:75:29)
              at QueryBuilder_MySQL.toSQL (/node_modules/knex/lib/query/querybuilder.js:84:44)
              at ensureConnectionCallback (/node_modules/knex/lib/execution/internal/ensure-connection-callback.js:4:30)
              at Runner.ensureConnection (/node_modules/knex/lib/execution/runner.js:318:20)
              at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
              at async Runner.run (/node_modules/knex/lib/execution/runner.js:30:19)
              at async file:///node_modules/@wbce-d9/api/dist/services/items.js:471:21
    }

From my package-lock.json:


    "node_modules/@wbce-d9/directus9": {
      "version": "10.3.4",
      "resolved": "https://registry.npmjs.org/@wbce-d9/directus9/-/directus9-10.3.4.tgz",
      "integrity": "sha512-GO+eiSg/YAICDmXwcOFfHGoWnUA7ejdgDmXatVp421Nks0dW1f6DKLm6jSqTzcrX/4TXeDKk9mTdSXzmFBzdxw==",
      

To Reproduce

Login with google, log out, attempt to login again

Directus Version

@wbce-d9/directus9 10.3.4

Hosting Strategy

Self-Hosted (Custom)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions