Fix Bug 62511: Uninformative error when session time expires
This commit is contained in:
parent
d145872b6e
commit
e3bc603f9d
@ -57,9 +57,9 @@ class AxiosClient {
|
||||
initSSR = (headers) => {
|
||||
this.isSSR = true;
|
||||
|
||||
const proto = headers['x-forwarded-proto']?.split(',').shift();
|
||||
const host = headers['x-forwarded-host']?.split(',').shift();
|
||||
|
||||
const proto = headers["x-forwarded-proto"]?.split(",").shift();
|
||||
const host = headers["x-forwarded-host"]?.split(",").shift();
|
||||
|
||||
const origin = apiOrigin || `${proto}://${host}`;
|
||||
|
||||
const apiBaseURL = combineUrl(origin, proxyURL, apiPrefix);
|
||||
@ -143,7 +143,7 @@ class AxiosClient {
|
||||
url: "/authentication/logout",
|
||||
}).then(() => {
|
||||
this.setWithCredentialsStatus(false);
|
||||
window.location.href = loginURL;
|
||||
window.location.href = `${loginURL}?authError=true`;
|
||||
});
|
||||
break;
|
||||
case 402:
|
||||
|
3
packages/login/index.d.ts
vendored
3
packages/login/index.d.ts
vendored
@ -25,7 +25,8 @@ declare global {
|
||||
type MatchType = {
|
||||
confirmedEmail?: string;
|
||||
message?: string;
|
||||
messageKey?: number;
|
||||
messageKey?: string;
|
||||
authError?: string;
|
||||
};
|
||||
|
||||
type PasswordHashType = {
|
||||
|
@ -52,17 +52,17 @@ const LoginForm: React.FC<ILoginFormProps> = ({
|
||||
const [isDisabled, setIsDisabled] = useState(false);
|
||||
const [isChecked, setIsChecked] = useState(false);
|
||||
const [isDialogVisible, setIsDialogVisible] = useState(false);
|
||||
const [isWithoutPasswordLogin, setIsWithoutPasswordLogin] = useState(
|
||||
IS_ROOMS_MODE
|
||||
);
|
||||
const [isWithoutPasswordLogin, setIsWithoutPasswordLogin] =
|
||||
useState(IS_ROOMS_MODE);
|
||||
|
||||
const inputRef = useRef<HTMLInputElement>(null);
|
||||
|
||||
const { t, ready } = useTranslation(["Login", "Common"]);
|
||||
|
||||
const { message, confirmedEmail } = match || {
|
||||
const { message, confirmedEmail, authError } = match || {
|
||||
message: "",
|
||||
confirmedEmail: "",
|
||||
authError: "",
|
||||
};
|
||||
|
||||
const authCallback = (profile: string) => {
|
||||
@ -108,6 +108,7 @@ const LoginForm: React.FC<ILoginFormProps> = ({
|
||||
const text = `${messageEmailConfirmed} ${messageAuthorize}`;
|
||||
|
||||
confirmedEmail && ready && toastr.success(text);
|
||||
authError && ready && toastr.error(t("Common:ProviderLoginError"));
|
||||
|
||||
focusInput();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user