mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 05:10:19 +08:00
Merge two login functions.
This commit is contained in:
@ -44,14 +44,6 @@ export function logout() {
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
||||
export function authLogin(values) {
|
||||
return fetch(`${authConfig.serverUrl}/api/auth/login`, {
|
||||
method: 'POST',
|
||||
credentials: "include",
|
||||
body: JSON.stringify(values),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
||||
export function getOAuthCode(clientId, responseType, redirectUri, scope, state) {
|
||||
return fetch(`${authConfig.serverUrl}/api/oauth/code?clientId=${clientId}&responseType=${responseType}&redirectUri=${redirectUri}&scope=${scope}&state=${state}`, {
|
||||
method: 'GET',
|
||||
|
@ -46,7 +46,7 @@ class AuthCallback extends React.Component {
|
||||
redirectUri: redirectUri,
|
||||
method: this.state.method,
|
||||
};
|
||||
AuthBackend.authLogin(body)
|
||||
AuthBackend.login(body)
|
||||
.then((res) => {
|
||||
if (res.status === "ok") {
|
||||
window.location.href = '/';
|
||||
|
Reference in New Issue
Block a user