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

Function mockShortLivedAuth

spec/helper.js:406–423  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

404}
405
406function mockShortLivedAuth() {
407 const auth = {};
408 let accessToken;
409 auth.setValidAccessToken = function (validAccessToken) {
410 accessToken = validAccessToken;
411 };
412 auth.validateAuthData = function (authData) {
413 if (authData.access_token == accessToken) {
414 return Promise.resolve();
415 } else {
416 return Promise.reject('Invalid access token');
417 }
418 };
419 auth.validateAppId = function () {
420 return Promise.resolve();
421 };
422 return auth;
423}
424
425function mockFetch(mockResponses) {
426 const spy = jasmine.createSpy('fetch');

Callers 1

helper.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected