chore: Revert "feat: restrict redirectUrls for CAS login" (#2234)

This reverts commit b7a37126ad.
This commit is contained in:
hsluoyz
2023-08-19 00:30:35 +08:00
committed by GitHub
parent 134541acde
commit a2db61cc1a
4 changed files with 6 additions and 29 deletions

View File

@ -173,12 +173,7 @@ class LoginPage extends React.Component {
this.onUpdateApplication(res.data);
});
} else {
let redirectUri = "";
if (this.state.type === "cas") {
const casParams = Util.getCasParameters();
redirectUri = casParams.service;
}
OrganizationBackend.getDefaultApplication("admin", this.state.owner, this.state.type, redirectUri)
OrganizationBackend.getDefaultApplication("admin", this.state.owner)
.then((res) => {
if (res.status === "ok") {
const application = res.data;
@ -188,9 +183,9 @@ class LoginPage extends React.Component {
});
} else {
this.onUpdateApplication(null);
this.setState({
msg: res.msg,
});
Setting.showMessage("error", res.msg);
this.props.history.push("/404");
}
});
}

View File

@ -70,8 +70,8 @@ export function deleteOrganization(organization) {
}).then(res => res.json());
}
export function getDefaultApplication(owner, name, type = "", redirectUri = "") {
return fetch(`${Setting.ServerUrl}/api/get-default-application?id=${owner}/${encodeURIComponent(name)}&type=${type}&redirectUri=${redirectUri}`, {
export function getDefaultApplication(owner, name) {
return fetch(`${Setting.ServerUrl}/api/get-default-application?id=${owner}/${encodeURIComponent(name)}`, {
method: "GET",
credentials: "include",
headers: {