Track HiveGrid Cloud planning reference
This commit is contained in:
1 parent
b3d5ea6764
commit
e341c5938a
5784 files changed
+1104929
-3
No files matched your search
@@ -0,0 +1,20 @@
|
||||
import { ActionFunction, redirect } from "react-router";
|
||||
import { getDomainRoutingConfig } from "@toolctrl/config";
|
||||
import { withMetrics } from "~/lib/metrics/ssr";
|
||||
import { createLogLogout } from "~/utils/db/logs.db.server";
|
||||
import { absoluteAppRootPath } from "~/utils/app/CrossHostUrls";
|
||||
|
||||
import { getUserInfo, logout, validateCSRFToken } from "~/utils/session.server";
|
||||
|
||||
export const action: ActionFunction = async ({ request }) => {
|
||||
await validateCSRFToken(request);
|
||||
const userInfo = await getUserInfo(request);
|
||||
if (userInfo.userId) {
|
||||
createLogLogout(request, userInfo.userId);
|
||||
}
|
||||
return logout(request);
|
||||
};
|
||||
|
||||
export const loader = withMetrics("logout", async () => {
|
||||
throw redirect(absoluteAppRootPath(getDomainRoutingConfig()));
|
||||
});
|
||||
Reference in new issue
Block a user