Merge branch 'release/rc-v1.2.0' into feature/static-versioned
This commit is contained in:
commit
cd581cb15d
@ -124,7 +124,10 @@ class AxiosClient {
|
||||
// : error.message;
|
||||
|
||||
if (error?.response?.status === 401 && this.isSSR) {
|
||||
error.response.data.error.message = 401;
|
||||
error.response.data = {
|
||||
...error?.response?.data,
|
||||
error: { ...error?.response?.data?.error, message: 401 },
|
||||
};
|
||||
}
|
||||
|
||||
const loginURL = combineUrl(proxyURL, "/login");
|
||||
|
@ -96,9 +96,12 @@ function Editor({
|
||||
}
|
||||
useEffect(() => {
|
||||
if (error && mfReady) {
|
||||
if (error?.unAuthorized && error?.redirectPath) {
|
||||
if (error?.unAuthorized) {
|
||||
localStorage.setItem("redirectPath", window.location.href);
|
||||
window.location.href = error?.redirectPath;
|
||||
window.open(
|
||||
combineUrl(window.DocSpaceConfig?.proxy?.url, "/login"),
|
||||
"_self"
|
||||
);
|
||||
}
|
||||
const errorText = typeof error === "string" ? error : error.errorMessage;
|
||||
toastr.error(errorText);
|
||||
|
@ -80,15 +80,16 @@ export const initDocEditor = async (req) => {
|
||||
]);
|
||||
|
||||
const successAuth = !!user;
|
||||
|
||||
personal = settings?.personal;
|
||||
|
||||
if (!successAuth && !doc) {
|
||||
error = {
|
||||
unAuthorized: true,
|
||||
redirectPath: combineUrl(
|
||||
window.DocSpaceConfig?.proxy?.url,
|
||||
personal ? "/sign-in" : "/login"
|
||||
),
|
||||
// redirectPath: combineUrl(
|
||||
// window?.DocSpaceConfig?.proxy?.url,
|
||||
// personal ? "/sign-in" : "/login"
|
||||
// ),
|
||||
};
|
||||
return { error };
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user