Prevent JWT token from showing up on error page

This commit is contained in:
SleeplessOne1917 2023-07-02 15:45:45 -04:00
parent 3e7aca043b
commit 31789495a2
2 changed files with 8 additions and 1 deletions

View file

@ -1,4 +1,5 @@
import { setIsoData } from "@utils/app";
import removeAuthParam from "@utils/helpers/remove-auth-param";
import { Component } from "inferno";
import { T } from "inferno-i18next-dess";
import { Link } from "inferno-router";
@ -58,7 +59,7 @@ export class ErrorPage extends Component<any, any> {
<T
i18nKey="error_code_message"
parent="p"
interpolation={{ error: errorPageData.error }}
interpolation={{ error: removeAuthParam(errorPageData.error) }}
>
#<strong className="text-danger">#</strong>#
</T>

View file

@ -0,0 +1,6 @@
export default function (err: any) {
return err
.toString()
.replace(new RegExp("[?&]auth=[^&#]*(#.*)?$"), "$1")
.replace(new RegExp("([?&])auth=[^&]*&"), "$1");
}