Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(oauth): return updated object value key instead of complex patched object that causes crash #3574

Open
wants to merge 1 commit into
base: dove
Choose a base branch
from

Conversation

francescochiapello
Copy link

@francescochiapello francescochiapello commented Mar 11, 2025

OAuth is not working since the object returned from patch function is a complex object composed by value item that contains the payload of the user account.

There are not other open issues that are related to this and this PR is not dependent on PRs in other repos.

@francescochiapello
Copy link
Author

Hi guys, without this PR merged, is not possible to handle oauth login using Facebook, Google or other third party provider. Please have a look at it and if possible merge it to fethers repo. Thanks a lot.

@daffl
Copy link
Member

daffl commented Mar 20, 2025

Is there a way to confirm this. Aside from the compilation failing I just tested the existing setup with Google and it worked as expected.

@francescochiapello
Copy link
Author

Hi @daffl, I've tested it multiple times with this version "@feathersjs/authentication-oauth": "^5.0.31" and when I register a user it's working well, but after trying to sign in again with Google, this line

return this.entityService.patch(id, data, _.omit(params, 'query'))

on this method

  async updateEntity(entity: any, profile: OAuthProfile, params: Params) {
    const id = entity[this.entityId]
    const data = await this.getEntityData(profile, entity, params)

    debug(`updateEntity with id ${id} and data`, data)

    return this.entityService.patch(id, data, _.omit(params, 'query'))
  }

is returning an object that has inside a value object with the mongodb loggedin user object.

@francescochiapello
Copy link
Author

Hi @daffl , this is what I mean with value object returned by path service.

google-values

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants