-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
228 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,28 @@ | ||
'use client'; | ||
import React from 'react'; | ||
"use client"; | ||
import React from "react"; | ||
import { googleLogout } from "@react-oauth/google"; | ||
|
||
|
||
const Page = () => { | ||
const handleLogout = () => { | ||
googleLogout(); | ||
// Remove the token from local storage | ||
localStorage.removeItem('token'); | ||
localStorage.removeItem("token"); | ||
// Redirect the user to the login page after logging out | ||
window.location.href = '/loginPage'; | ||
console.log('Logged out successfully'); | ||
window.location.href = "/loginPage"; | ||
console.log("Logged out successfully"); | ||
}; | ||
|
||
return ( | ||
<div> | ||
<h1>Profile</h1> | ||
<button onClick={() => handleLogout()} className="hover:underline decoration-yellow-400 underline-offset-8 top-0 right-0 m-5 p-2 text-[#003C6C] font-medium text-xl"> | ||
Logout | ||
<button | ||
onClick={() => handleLogout()} | ||
className="hover:underline decoration-yellow-400 underline-offset-8 top-0 right-0 m-5 p-2 text-[#003C6C] font-medium text-xl" | ||
> | ||
Logout | ||
</button> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Page; | ||
export default Page; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.