* 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)
| 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 |
no outgoing calls
no test coverage detected