Files
openpanel/packages/devtools-ui/src/utils/auth.ts
Stefan Pejcic 8595a9f4e5 back
2024-05-08 19:58:53 +02:00

25 lines
458 B
TypeScript

import { ory } from "./ory";
export const isAuthenticated = async () => {
try {
await ory.toSession();
return true;
} catch (error: any) {
return false;
}
};
export const logoutUser = async () => {
try {
await ory.performNativeLogout({
performNativeLogoutBody: {
session_token: "",
},
});
return true;
} catch (_) {
return false;
}
};