mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-07 03:57:09 +03:00
Merge pull request #1564 from mini-bomba/userinfo-publicID
Use publicID instead of privateID for /userInfo calls
This commit is contained in:
@@ -532,7 +532,7 @@ function activatePrivateTextChange(element: HTMLElement) {
|
|||||||
case "userID":
|
case "userID":
|
||||||
if (Config.config[option]) {
|
if (Config.config[option]) {
|
||||||
utils.asyncRequestToServer("GET", "/api/userInfo", {
|
utils.asyncRequestToServer("GET", "/api/userInfo", {
|
||||||
userID: Config.config[option],
|
publicUserID: utils.getHash(Config.config[option]),
|
||||||
values: ["warnings", "banned"]
|
values: ["warnings", "banned"]
|
||||||
}).then((result) => {
|
}).then((result) => {
|
||||||
const userInfo = JSON.parse(result.responseText);
|
const userInfo = JSON.parse(result.responseText);
|
||||||
|
|||||||
@@ -281,7 +281,7 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
|
|||||||
if (!Config.config.payments.freeAccess && !noRefreshFetchingChaptersAllowed()) values.push("freeChaptersAccess");
|
if (!Config.config.payments.freeAccess && !noRefreshFetchingChaptersAllowed()) values.push("freeChaptersAccess");
|
||||||
|
|
||||||
utils.asyncRequestToServer("GET", "/api/userInfo", {
|
utils.asyncRequestToServer("GET", "/api/userInfo", {
|
||||||
userID: Config.config.userID,
|
publicUserID: await utils.getHash(Config.config.userID),
|
||||||
values
|
values
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ export async function fetchingChaptersAllowed(): Promise<boolean> {
|
|||||||
// Check for free access if no license key, and it is the first time
|
// Check for free access if no license key, and it is the first time
|
||||||
const result = await utils.asyncRequestToServer("GET", "/api/userInfo", {
|
const result = await utils.asyncRequestToServer("GET", "/api/userInfo", {
|
||||||
value: "freeChaptersAccess",
|
value: "freeChaptersAccess",
|
||||||
userID: Config.config.userID
|
publicUserID: await utils.getHash(Config.config.userID)
|
||||||
});
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ export interface ChatConfig {
|
|||||||
|
|
||||||
export async function openWarningDialog(contentContainer: ContentContainer): Promise<void> {
|
export async function openWarningDialog(contentContainer: ContentContainer): Promise<void> {
|
||||||
const userInfo = await utils.asyncRequestToServer("GET", "/api/userInfo", {
|
const userInfo = await utils.asyncRequestToServer("GET", "/api/userInfo", {
|
||||||
userID: Config.config.userID,
|
publicUserID: await utils.getHash(Config.config.userID),
|
||||||
values: ["warningReason"]
|
values: ["warningReason"]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user