Comment on page
logout
import React from 'react';
import { useSlashAuth } from '@slashauth/slashauth-react';
export const Logout = () => {
const { logout } = useSlashAuth();
return <button onClick={() => logout()}>Logout</button>;
};
void
When
true
, this skips the request to the logout endpoint on the authorization server, effectively performing a "local" logout of the application. No redirect should take place, you should update local logged in state.import React from 'react';
import { useSlashAuth } from '@slashauth/slashauth-react';
export const Logout = () => {
const { logout } = useSlashAuth();
return <button onClick={() => logout({ localOnly: true })}>Logout</button>;
};
Last modified 10mo ago