parse-community / parse-community/parse-server

User is always being detected as new when logged in through Facebook, Twitter, or Google

Open
#7,737 25 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type:question
Dominant language
JavaScript
Stars
21.4k
Forks
4.8k
Avg merge
7h 45m
Merged PRs (30d)
11

Description

New Issue Checklist
Issue Description

-A user is being detected as new when he isn't.
-authData field being deleted for unknown reasons.

Steps to reproduce

Add the following code to the cloud code and try to login using Facebook, Twitter, or Google.

Parse.Cloud.afterSave(Parse.User, async (request) => {
    if (!request.original) {
       "need to perform some actions here when a user has just signed up"
      }
});
Actual Outcome

This issue leads to performing unwanted actions over a non new user.
After a user performs a login/signup through Facebook, Twitter, or Google, the user is always being detected as a new user in afterSave.
When checking again in the database you can see that the same user has just logged in and it's not a new one,
Noticed also something with the authData field, when testing login with different methods the authData is being erased(doesn't happen all the time).

Expected Outcome

Not detect a user as a new one when he isn't.

Environment

Server

  • Parse Server version: parse-server@5.0.0-alpha.3
  • Operating system: Windows 10
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): Local

Database

  • System (MongoDB or Postgres): MongoDB
  • Database version: FILL_THIS_OUT
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): MongoDB Atlas

Client

  • SDK (iOS, Android, JavaScript, PHP, Unity, etc): Android
  • SDK version: 1.26.0
Logs

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Facebook, Twitter, and Google login flows described in the issue, focusing on Parse.Cloud.afterSave(Parse.User), request.original, and authData. Compare repeat logins with first-time signups and verify that existing users are not treated as new and that authData is preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, mongodb, node.js
Domain
api, authentication, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.