Skip to content

Create/Update User after first login with initialization logic breaks if collection holds relationships object fields #76

@angelocacitai

Description

@angelocacitai

Hi,

I am trying to use the payload-oauth2 plugin prepopulating user with a default Role Object.

What happens is that it returns me the following error:

Failed query: insert into "users_rels" ("id", "order", "parent_id", "path", "roles_id") values (default, $1, $2, $3, $4) returning "id", "order", "parent_id", "path", "roles_id" params: 1,6,roles,[object Object]

The [object object] refers to the injected Roles with hook.

I thought that it only update the info returned in getUserInfo() that inside my logic are:

return {
  email: profile.email,
  username: profile.preferred_username,
  sub: profile.sub,  
}

Am I missing something about the plugin behaviour on create/update user?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions