Skip to content

Commit

Permalink
fix: logout sample
Browse files Browse the repository at this point in the history
  • Loading branch information
jamalavedra committed Jun 20, 2024
1 parent 170112d commit e438cea
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/apps/auth-sample/src/components/Logout.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import React from 'react';
import {useOpenfort} from '../hooks/useOpenfort';
import {useRouter} from 'next/router';

const LogoutButton: React.FC = () => {
const {logout} = useOpenfort();

const router = useRouter();
const handleLogout = async () => {
try {
await logout();
router.push('/login');
} catch (error) {
console.error('Logout failed:', error);
alert('Logout failed. Please try again.');
Expand Down

0 comments on commit e438cea

Please sign in to comment.