MCPcopy Index your code
hub / github.com/parse-community/parse-server / _sanitizeAuthData

Method _sanitizeAuthData

src/Routers/UsersRouter.js:48–63  ·  view source on GitHub ↗

* After retrieving a user directly from the database, we need to remove the * password from the object (for security), and fix an issue some SDKs have * with null values

(user)

Source from the content-addressed store, hash-verified

46 * with null values
47 */
48 _sanitizeAuthData(user) {
49 delete user.password;
50
51 // Sometimes the authData still has null on that keys
52 // https://github.com/parse-community/parse-server/issues/935
53 if (user.authData) {
54 Object.keys(user.authData).forEach(provider => {
55 if (user.authData[provider] === null) {
56 delete user.authData[provider];
57 }
58 });
59 if (Object.keys(user.authData).length == 0) {
60 delete user.authData;
61 }
62 }
63 }
64
65 /**
66 * Validates a password request in login and verifyPassword

Callers 3

handleLogInAsMethod · 0.95
handleResetRequestMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected