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,6 +1,6 @@
/** Mocked data */
export default function ({faker, url, body, login = faker.internet.userName()}) {
if (/^https:..graphql.anilist.co/.test(url)) {
if (/^https:..graphql.anilist.co.*$/.test(url)) {
//Initialization and media generator
const query = body.query
const media = ({type}) => ({

View File

@@ -3,7 +3,7 @@
/** Mocked data */
export default function ({faker, url, body, login = faker.internet.userName()}) {
if (/^https:..accounts.spotify.com.api.token/.test(url)) {
if (/^https:..accounts.spotify.com.api.token.*$/.test(url)) {
//Access token generator
const params = new urls.URLSearchParams(body)
if ((params.get("grant_type") === "refresh_token")&&(params.get("client_id") === "MOCKED_CLIENT_ID")&&(params.get("client_secret") === "MOCKED_CLIENT_SECRET")&&(params.get("refresh_token") === "MOCKED_REFRESH_TOKEN")) {