improvements
This commit is contained in:
@@ -10,6 +10,7 @@ import UserMetadata from "supertokens-node/recipe/usermetadata";
|
||||
import { getSessionForStart } from "@/lib/supertokens/recipes/start-session";
|
||||
import { Logger } from "@/lib/logger";
|
||||
import z from "zod";
|
||||
import { serverFnLoggingMiddleware } from "./activities";
|
||||
const logger = new Logger("Middleware");
|
||||
|
||||
const verifySuperTokensSession = async (
|
||||
@@ -190,7 +191,7 @@ export const setUserMetadata = createServerFn({ method: "POST" })
|
||||
|
||||
export const updateUserColorScheme = createServerFn({ method: "POST" })
|
||||
.inputValidator((data: string) => data)
|
||||
.middleware([superTokensFunctionMiddleware])
|
||||
.middleware([superTokensFunctionMiddleware, serverFnLoggingMiddleware])
|
||||
.handler(async ({ context, data }) => {
|
||||
const { userAuthId, metadata } = context;
|
||||
if (!userAuthId) return;
|
||||
@@ -209,7 +210,7 @@ export const updateUserColorScheme = createServerFn({ method: "POST" })
|
||||
|
||||
export const updateUserAccentColor = createServerFn({ method: "POST" })
|
||||
.inputValidator((data: string) => data)
|
||||
.middleware([superTokensFunctionMiddleware])
|
||||
.middleware([superTokensFunctionMiddleware, serverFnLoggingMiddleware])
|
||||
.handler(async ({ context, data }) => {
|
||||
const { userAuthId, metadata } = context;
|
||||
if (!userAuthId) return;
|
||||
|
||||
Reference in New Issue
Block a user