Skip to content

User creation with username and password not possible anymore #506

@d-klotz

Description

@d-klotz

The following request is not possible anymore:

curl -X POST "http://localhost:3001/user/create" \
  -H "Content-Type: application/json" \
  -d '{
    "username": "app-user-quo-default-user",
    "password": "password123"
  }'

Backend logs:

ANY /user/create (λ: user)
Running in offline mode
[Frigg] Field-level encryption disabled
prisma:error 
Invalid `this.prisma.token.create()` invocation in
/Users/danielklotz/projects/lefthook/quo--frigg/backend/node_modules/@friggframework/core/token/repositories/token-repository-postgres.js:70:47

  67 // Calculate expiration time
  68 const expires = new Date(Date.now() + minutes * 60000);
  69 
→ 70 const token = await this.prisma.token.create({
       data: {
         token: "$2a$10$JipKP5FS2Fr/WH/yEF8YJOeN/XVBZ7OZWbTfwp7t4h7kmsS1rmEq2",
         expires: new Date("2025-11-25T18:36:37.874Z"),
         userId: null,
     +   user: {
     +     create: UserCreateWithoutTokensInput | UserUncheckedCreateWithoutTokensInput,
     +     connectOrCreate: UserCreateOrConnectWithoutTokensInput,
     +     connect: UserWhereUniqueInput
     +   }
       }
     })

Argument `user` is missing.
PrismaClientValidationError: 
Invalid `this.prisma.token.create()` invocation in
/Users/danielklotz/projects/lefthook/quo--frigg/backend/node_modules/@friggframework/core/token/repositories/token-repository-postgres.js:70:47

  67 // Calculate expiration time
  68 const expires = new Date(Date.now() + minutes * 60000);
  69 
→ 70 const token = await this.prisma.token.create({
       data: {
         token: "$2a$10$JipKP5FS2Fr/WH/yEF8YJOeN/XVBZ7OZWbTfwp7t4h7kmsS1rmEq2",
         expires: new Date("2025-11-25T18:36:37.874Z"),
         userId: null,
     +   user: {
     +     create: UserCreateWithoutTokensInput | UserUncheckedCreateWithoutTokensInput,
     +     connectOrCreate: UserCreateOrConnectWithoutTokensInput,
     +     connect: UserWhereUniqueInput
     +   }
       }
     })

Argument `user` is missing.
    at oa (/Users/danielklotz/projects/lefthook/quo--frigg/backend/node_modules/@friggframework/core/generated/prisma-postgresql/runtime/binary.js:160:1375)
    at bl.handleRequestError (/Users/danielklotz/projects/lefthook/quo--frigg/backend/node_modules/@friggframework/core/generated/prisma-postgresql/runtime/binary.js:262:6913)
    at bl.handleAndLogRequestError (/Users/danielklotz/projects/lefthook/quo--frigg/backend/node_modules/@friggframework/core/generated/prisma-postgresql/runtime/binary.js:262:6594)
    at bl.request (/Users/danielklotz/projects/lefthook/quo--frigg/backend/node_modules/@friggframework/core/generated/prisma-postgresql/runtime/binary.js:262:6301)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async o (/Users/danielklotz/projects/lefthook/quo--frigg/backend/node_modules/@friggframework/core/generated/prisma-postgresql/runtime/binary.js:271:9560)
    at async TokenRepositoryPostgres.createTokenWithExpire (/Users/danielklotz/projects/lefthook/quo--frigg/backend/node_modules/@friggframework/core/token/repositories/token-repository-postgres.js:70:23)
    at async UserRepositoryPostgres.createToken (/Users/danielklotz/projects/lefthook/quo--frigg/backend/node_modules/@friggframework/core/user/repositories/user-repository-postgres.js:118:30)
    at async /Users/danielklotz/projects/lefthook/quo--frigg/backend/node_modules/@friggframework/core/handlers/routers/user.js:55:23 {
  clientVersion: '6.19.0',
  isBoom: true,
  isServer: true,
  data: null,
  output: {
    statusCode: 500,
    payload: {
      statusCode: 500,
      error: 'Internal Server Error',
      message: 'An internal server error occurred'
    },
    headers: {}
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions