mirror of
https://github.com/stefanpejcic/openpanel
synced 2025-06-26 18:28:26 +00:00
fork refine
This commit is contained in:
24
packages/devtools-ui/src/utils/auth.ts
Normal file
24
packages/devtools-ui/src/utils/auth.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
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;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user