OAuth2: remove useless cookie
This commit is contained in:
parent
ea9073c4e0
commit
2fdc2d84ff
@ -139,6 +139,10 @@ export const onOAuthLogin = () => {
|
||||
method: "post",
|
||||
url: `/oauth2/login`,
|
||||
data: formData,
|
||||
withRedirect: true,
|
||||
headers: {
|
||||
"X-Disable-Redirect": true,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
@ -161,6 +165,9 @@ export const onOAuthSubmit = (
|
||||
url: `/oauth2/authorize`,
|
||||
data: formData,
|
||||
withRedirect: true,
|
||||
headers: {
|
||||
"X-Disable-Redirect": true,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
@ -175,6 +182,9 @@ export const onOAuthCancel = (clientId: string, clientState: string) => {
|
||||
url: `/oauth2/authorize`,
|
||||
data: formData,
|
||||
withRedirect: true,
|
||||
headers: {
|
||||
"X-Disable-Redirect": true,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -130,7 +130,6 @@ class AxiosClient {
|
||||
if (error) throw new Error(error);
|
||||
|
||||
if (response.headers["x-redirect-uri"] && options.withRedirect) {
|
||||
deleteCookie("disable_redirect");
|
||||
return window.location.replace(response.headers["x-redirect-uri"]);
|
||||
}
|
||||
|
||||
|
@ -92,7 +92,6 @@ const Consent = ({
|
||||
let clientState = "";
|
||||
const scope = oauth.client.scopes;
|
||||
|
||||
setCookie("disable_redirect", true);
|
||||
setCookie("client_id", clientId);
|
||||
|
||||
await api.oauth.onOAuthLogin();
|
||||
@ -117,8 +116,6 @@ const Consent = ({
|
||||
|
||||
setCookie("client_id", clientId);
|
||||
|
||||
setCookie("disable_redirect", true);
|
||||
|
||||
await api.oauth.onOAuthLogin();
|
||||
|
||||
const cookie = document.cookie.split(";");
|
||||
|
Loading…
Reference in New Issue
Block a user