Add github oauth.

This commit is contained in:
Yang Luo
2021-02-14 00:22:24 +08:00
parent ea09beffe2
commit c81118feff
14 changed files with 419 additions and 8 deletions

View File

@ -50,3 +50,11 @@ export function logout() {
credentials: "include",
}).then(res => res.json());
}
export function githubLogin(providerName, code, state, redirectUrl, addition) {
console.log(redirectUrl)
return fetch(`${Setting.ServerUrl}/api/auth/github?provider=${providerName}&code=${code}&state=${state}&redirect_url=${redirectUrl}&addition=${addition}`, {
method: 'GET',
credentials: 'include',
}).then(res => res.json());
}