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

feat: Upgrade to Parse JS SDK 5 #8816

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
130 changes: 72 additions & 58 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"mongodb": "5.9.0",
"mustache": "4.2.0",
"otpauth": "9.2.2",
"parse": "4.1.0",
"parse": "5.0.0-alpha.2",
"path-to-regexp": "6.2.1",
"pg-monitor": "2.0.0",
"pg-promise": "11.5.4",
Expand Down
7 changes: 5 additions & 2 deletions src/RestWrite.js
Original file line number Diff line number Diff line change
Expand Up @@ -524,8 +524,7 @@ RestWrite.prototype.handleAuthData = async function (authData) {
const results = this.filteredObjectsByACL(r);

if (results.length > 1) {
// To avoid https://github.com/parse-community/parse-server/security/advisories/GHSA-8w3j-g983-8jh5
// Let's run some validation before throwing
// Run validation before throwing to avoid https://github.com/parse-community/parse-server/security/advisories/GHSA-8w3j-g983-8jh5
await Auth.handleAuthDataValidation(authData, this, results[0]);
throw new Parse.Error(Parse.Error.ACCOUNT_ALREADY_LINKED, 'this auth is already used');
}
Expand All @@ -546,6 +545,10 @@ RestWrite.prototype.handleAuthData = async function (authData) {
if (results.length === 1) {
const userId = this.getUserId();
const userResult = results[0];

// Run validation to avoid https://github.com/parse-community/parse-server/security/advisories/GHSA-8w3j-g983-8jh5
await Auth.handleAuthDataValidation(authData, this, userResult);

// Prevent duplicate authData id
if (userId && userId !== userResult.objectId) {
throw new Parse.Error(Parse.Error.ACCOUNT_ALREADY_LINKED, 'this auth is already used');
Expand Down
Loading