Add support for token "NOT_NEEDED" for standalone plugins (#83)

This commit is contained in:
Simon Lecoq
2021-01-30 13:51:54 +01:00
committed by GitHub
parent 682e43e10b
commit b74f88a0ee
11 changed files with 42 additions and 11 deletions

View File

@@ -1,7 +1,7 @@
/** Mocked data */
export default function ({faker, url, options, login = faker.internet.userName()}) {
//Spotify api
if (/^https:..api.spotify.com/.test(url)) {
if (/^https:..api.spotify.com.*$/.test(url)) {
//Get recently played tracks
if (/me.player.recently-played/.test(url)&&(options?.headers?.Authorization === "Bearer MOCKED_TOKEN_ACCESS")) {
console.debug(`metrics/compute/mocks > mocking spotify api result > ${url}`)