MCPcopy Create free account
hub / github.com/parse-community/parse-server / validateAuthData

Function validateAuthData

src/Adapters/Auth/phantauth.js:14–28  ·  view source on GitHub ↗
(authData)

Source from the content-addressed store, hash-verified

12
13// Returns a promise that fulfills if this user id is valid.
14async 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.
31function validateAppId() {

Callers

nothing calls this directly

Calls 3

logRuntimeDeprecationMethod · 0.80
requestFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…