From fd6aff439a7cddddcf9fefaa7d9a217516c8e4ac Mon Sep 17 00:00:00 2001 From: Ritu Kumari <131888939+ritukumari89@users.noreply.github.com> Date: Fri, 20 Oct 2023 19:54:31 +0530 Subject: [PATCH] Github Login --- Github Login/Github.js | 11 +++++ Github Login/GithubLogin.html | 13 ++++++ Github Login/GithubProfile.html | 78 +++++++++++++++++++++++++++++++++ 3 files changed, 102 insertions(+) create mode 100644 Github Login/Github.js create mode 100644 Github Login/GithubLogin.html create mode 100644 Github Login/GithubProfile.html diff --git a/Github Login/Github.js b/Github Login/Github.js new file mode 100644 index 0000000..a2dd19b --- /dev/null +++ b/Github Login/Github.js @@ -0,0 +1,11 @@ +const githubLoginButton = document.getElementById("github-login-button"); + +githubLoginButton.addEventListener("click", () => { + const clientID = "9b422344fa31d0dfaa43"; + const redirectURI = "http://127.0.0.1:5500/GithubProfile.html"; + const scope = "read:user"; + + const githubAuthURL = `https://github.com/login/oauth/authorize?client_id=${clientID}&redirect_uri=${redirectURI}&scope=${scope}`; + + window.location.replace(githubAuthURL); +}); diff --git a/Github Login/GithubLogin.html b/Github Login/GithubLogin.html new file mode 100644 index 0000000..9d71f69 --- /dev/null +++ b/Github Login/GithubLogin.html @@ -0,0 +1,13 @@ + + +
+ + + +