Init
This commit is contained in:
commit
1bd830bda3
7 changed files with 882 additions and 0 deletions
29
callback/callback.html
Normal file
29
callback/callback.html
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>OAuth Callback</title>
|
||||
</head>
|
||||
<body>
|
||||
<h2>처리 중입니다...</h2>
|
||||
|
||||
<script>
|
||||
const hash = window.location.hash.substring(1); // '#access_token=...'
|
||||
const params = new URLSearchParams(hash);
|
||||
const accessToken = params.get("access_token");
|
||||
|
||||
if (accessToken) {
|
||||
// 서버로 전송
|
||||
fetch("/token", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ access_token: accessToken })
|
||||
}).then(() => {
|
||||
document.body.innerHTML = "<h2>✅ Login Success!</h2>";
|
||||
document.body.innerHTML += "<a href='/'>go to home</a>";
|
||||
});
|
||||
} else {
|
||||
document.body.innerHTML = "<h2>❌ Error: Access Token does not exist.</h2>";
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue