Skip to content

Commit

Permalink
update code
Browse files Browse the repository at this point in the history
  • Loading branch information
BamaCharanChhandogi committed Feb 6, 2025
1 parent 9b1cdd8 commit 3e8c717
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default function App() {
});

// Store username with a proper key
document.cookie = `github_username=${githubUsername}; path=/;`;
document.cookie = githubUsername;

console.log("Updated Cookie:", document.cookie);
navigate("/home");
Expand Down
1 change: 1 addition & 0 deletions src/pages/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default function Home() {
const cookie = document.cookie;
function getGithubUsernameFromCookie() {
let cookies = document.cookie.split("; ");

let usernameCookie = cookies.find(cookie => !cookie.includes("=")); // Find standalone username
return usernameCookie ? usernameCookie.trim() : null;
}
Expand Down

0 comments on commit 3e8c717

Please sign in to comment.