Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on May 18, 2026. It is now read-only.
This repository was archived by the owner on May 18, 2026. It is now read-only.

🐛 Bug Report: Discord SSO #302

@ukdaaan

Description

@ukdaaan

👟 Reproduction steps

Enable the Discord SSO with correct callback urls

👍 Expected behavior

SSO process should complete without issues. (Other IDPs are working as expected without issues)

👎 Actual Behavior

SSO fails to link accounts with error 500, docker console logs below.

[Nest] 45  - 10/29/2023, 6:34:12 PM   ERROR [ExceptionsHandler] Cannot read properties of undefined (reading 'password')
TypeError: Cannot read properties of undefined (reading 'password')
    at UserController.getCurrentUser (/opt/app/backend/dist/src/user/user.controller.js:32:38)
    at /opt/app/backend/node_modules/@nestjs/core/router/router-execution-context.js:38:29
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[Nest] 45  - 10/29/2023, 6:34:16 PM   ERROR [ExceptionsHandler] Cannot read properties of undefined (reading 'password')
TypeError: Cannot read properties of undefined (reading 'password')
    at UserController.getCurrentUser (/opt/app/backend/dist/src/user/user.controller.js:32:38)
    at /opt/app/backend/node_modules/@nestjs/core/router/router-execution-context.js:38:29
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[Nest] 45  - 10/29/2023, 6:34:16 PM   ERROR [ExceptionsHandler] Cannot read properties of undefined (reading 'password')
TypeError: Cannot read properties of undefined (reading 'password')
    at UserController.getCurrentUser (/opt/app/backend/dist/src/user/user.controller.js:32:38)
    at /opt/app/backend/node_modules/@nestjs/core/router/router-execution-context.js:38:29
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[Nest] 45  - 10/29/2023, 6:34:18 PM   ERROR [ExceptionsHandler] Cannot read properties of undefined (reading 'password')
TypeError: Cannot read properties of undefined (reading 'password')
    at UserController.getCurrentUser (/opt/app/backend/dist/src/user/user.controller.js:32:38)
    at /opt/app/backend/node_modules/@nestjs/core/router/router-execution-context.js:38:29
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[Nest] 45  - 10/29/2023, 6:34:19 PM   ERROR [ExceptionsHandler] Cannot read properties of undefined (reading 'password')
TypeError: Cannot read properties of undefined (reading 'password')
    at UserController.getCurrentUser (/opt/app/backend/dist/src/user/user.controller.js:32:38)
    at /opt/app/backend/node_modules/@nestjs/core/router/router-execution-context.js:38:29
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[Nest] 45  - 10/29/2023, 6:34:23 PM   ERROR [ExceptionsHandler] Cannot read properties of undefined (reading 'password')
TypeError: Cannot read properties of undefined (reading 'password')
    at UserController.getCurrentUser (/opt/app/backend/dist/src/user/user.controller.js:32:38)
    at /opt/app/backend/node_modules/@nestjs/core/router/router-execution-context.js:38:29
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[Nest] 45  - 10/29/2023, 6:34:24 PM   ERROR [ExceptionsHandler] Cannot read properties of undefined (reading 'password')
TypeError: Cannot read properties of undefined (reading 'password')
    at UserController.getCurrentUser (/opt/app/backend/dist/src/user/user.controller.js:32:38)
    at /opt/app/backend/node_modules/@nestjs/core/router/router-execution-context.js:38:29
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[Nest] 45  - 10/29/2023, 6:34:24 PM   ERROR [ExceptionsHandler] Cannot read properties of undefined (reading 'password')
TypeError: Cannot read properties of undefined (reading 'password')
    at UserController.getCurrentUser (/opt/app/backend/dist/src/user/user.controller.js:32:38)
    at /opt/app/backend/node_modules/@nestjs/core/router/router-execution-context.js:38:29
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[Nest] 45  - 10/29/2023, 6:34:35 PM   ERROR [ExceptionsHandler] 
Invalid `this.prisma.oAuthUser.create()` invocation in
/opt/app/backend/dist/src/oauth/oauth.service.js:77:37
  74         `provider_${provider}`,
�������
  75     ]);
  76 }
→ 77 await this.prisma.oAuthUser.create({
       data: {
         userId: "bc026ba0-b75a-4eea-9200-d2349a8203f7",
         provider: "discord",
         providerUsername: undefined,
     +   providerUserId: String
       }
     })
Argument `providerUserId` is missing.
PrismaClientValidationError: 
Invalid `this.prisma.oAuthUser.create()` invocation in
/opt/app/backend/dist/src/oauth/oauth.service.js:77:37
  74         `provider_${provider}`,
�������
  75     ]);
  76 }
→ 77 await this.prisma.oAuthUser.create({
       data: {
         userId: "bc026ba0-b75a-4eea-9200-d2349a8203f7",
         provider: "discord",
         providerUsername: undefined,
     +   providerUserId: String
       }
     })
Argument `providerUserId` is missing.
    at Ur (/opt/app/backend/node_modules/@prisma/client/runtime/library.js:115:5803)
    at zr.handleRequestError (/opt/app/backend/node_modules/@prisma/client/runtime/library.js:122:8007)
    at zr.handleAndLogRequestError (/opt/app/backend/node_modules/@prisma/client/runtime/library.js:122:7697)
    at zr.request (/opt/app/backend/node_modules/@prisma/client/runtime/library.js:122:7307)
    at async OAuthService.link (/opt/app/backend/dist/src/oauth/oauth.service.js:77:9)
    at async OAuthController.callback (/opt/app/backend/dist/src/oauth/oauth.controller.js:53:13)

🌐 Browser

Firefox & Safari (MacOS)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions