Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(auth): Add sign out option #331

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

abs192
Copy link

@abs192 abs192 commented Feb 24, 2025

Fixes #30

Add sign out functionality to the application.

  • Sidebar Component:

    • Add a "Sign Out" button to the Sidebar component.
    • Implement the signOut function to remove the authentication token from cookies and redirect to /auth.
  • Auth Route:

    • Update the LoginForm component to handle redirection after sign out.
    • Ensure the user is redirected to the login page if they are not authenticated.

For more details, open the Copilot Workspace session.

Fixes xynehq#30

Add sign out functionality to the application.

* **Sidebar Component**:
  - Add a "Sign Out" button to the `Sidebar` component.
  - Implement the `signOut` function to remove the authentication token from cookies and redirect to `/auth`.

* **Auth Route**:
  - Update the `LoginForm` component to handle redirection after sign out.
  - Ensure the user is redirected to the login page if they are not authenticated.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/xynehq/xyne/issues/30?shareId=XXXX-XXXX-XXXX-XXXX).
@@ -23,6 +23,11 @@ export const Sidebar = ({
const location = useLocation()
const [showHistory, setShowHistory] = useState<boolean>(false)

const signOut = () => {
document.cookie = "auth-token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;"
window.location.href = "/auth"
Copy link

@subramanian-elavathur subramanian-elavathur Feb 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure this will trigger the router? Has this been tested locally?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2025-02-24 at 12 35 55 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a sign out option
2 participants