captcha: fix for custom invite form subpath
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
import { _get, _post } from "./common.js";
|
import { _get, _post } from "./common.js";
|
||||||
|
|
||||||
|
declare var window: GlobalWindow;
|
||||||
|
|
||||||
export class Captcha {
|
export class Captcha {
|
||||||
isPWR = false;
|
isPWR = false;
|
||||||
enabled = true;
|
enabled = true;
|
||||||
@@ -51,7 +53,7 @@ export class Captcha {
|
|||||||
this.captchaID = this.isPWR ? this.code : req.response["id"];
|
this.captchaID = this.isPWR ? this.code : req.response["id"];
|
||||||
// the Math.random() appearance below is used for PWRs, since they don't have a unique captchaID. The parameter is ignored by the server, but tells the browser to reload the image.
|
// the Math.random() appearance below is used for PWRs, since they don't have a unique captchaID. The parameter is ignored by the server, but tells the browser to reload the image.
|
||||||
document.getElementById("captcha-img").innerHTML = `
|
document.getElementById("captcha-img").innerHTML = `
|
||||||
<img class="w-full" src="${window.location.toString().substring(0, window.location.toString().lastIndexOf("/invite"))}/captcha/img/${this.code}/${this.isPWR ? Math.random() : this.captchaID}${this.isPWR ? "?pwr=true" : ""}"></img>
|
<img class="w-full" src="${window.location.toString().substring(0, window.location.toString().lastIndexOf(window.pages.Form))}/captcha/img/${this.code}/${this.isPWR ? Math.random() : this.captchaID}${this.isPWR ? "?pwr=true" : ""}"></img>
|
||||||
`;
|
`;
|
||||||
this.input.value = "";
|
this.input.value = "";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user