I am building a FE that is using Directus for auth and have followed the guides on SSO to auth users with google, and it’s working great! I’d like to now let users log out, and I can’t find any docs for how to do this, I assume there might be an endpoint I can call, like /admin/logout that supports a redirect, perhaps /auth/logout?
Hi, check this Authentication | Directus Docs
Just simply make a request to POST /auth/logout
OR
import { createDirectus, authentication, rest, logout } from '@directus/sdk';
const client = createDirectus('directus_project_url').with(authentication()).with(rest());
// logout using the authentication composable
const result = await client.logout();
// logout http request
const result = await client.request(logout(refresh_token));