(authData)
| 12 | |
| 13 | // Returns a promise that fulfills if this user id is valid. |
| 14 | async function validateAuthData(authData) { |
| 15 | const config = Config.get(Parse.applicationId); |
| 16 | |
| 17 | Deprecator.logRuntimeDeprecation({ usage: 'phantauth adapter' }); |
| 18 | |
| 19 | const phantauthConfig = config.auth.phantauth; |
| 20 | if (!phantauthConfig?.enableInsecureAuth) { |
| 21 | throw new Parse.Error(Parse.Error.INTERNAL_SERVER_ERROR, 'PhantAuth only works with enableInsecureAuth: true'); |
| 22 | } |
| 23 | |
| 24 | const data = await request('auth/userinfo', authData.access_token); |
| 25 | if (data?.sub !== authData.id) { |
| 26 | throw new Parse.Error(Parse.Error.OBJECT_NOT_FOUND, 'PhantAuth auth is invalid for this user.'); |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | // Returns a promise that fulfills if this app id is valid. |
| 31 | function validateAppId() { |
nothing calls this directly
no test coverage detected
searching dependent graphs…