COBEAS
Explore posts from serversCDCloudflare Developers
•Created by COBEAS on 11/25/2024 in #general-help
Pointed Nameservers don't show
Someone asked my help to set-up his DNS for a domain bought on Namecheap. But the Nameservers are pointing to Cloudflare but we don't see any DNS settings for this (or any) domain in his Cloudflare account. Is there a way we can find out where his DNS settings should be managed or are we just looking in the wrong location?
9 replies
TTCTheo's Typesafe Cult
•Created by COBEAS on 8/31/2024 in #questions
UT middleware with authentication and fileOverrides
I am trying to have a middleware in one of my upload routes where I authenticate a user and I want to add a customId to the upload. I can do one or the other but when I try to do both in the same middleware function I get a 500 error.
This is the code snippet, in this case user logs a correct object but then throws a 500 server error.
export const ourFileRouter = {
// Define as many FileRoutes as you like, each with a unique routeSlug
imageUploader: f({ image: { maxFileSize: "4MB", maxFileCount: 10 } })
.middleware(async ({ req, files }) => {
const user = await auth(req);
console.log("User in UT middleware", user);
if (!user) throw new UploadThingError("Unauthorized");
const fileOverrides = files.map((file) => {
const myIdentifier = file.name;
return { ...file, customId: myIdentifier };
});
return { foo: "bar" as const, [UTFiles]: fileOverrides }; }) .onUploadComplete(async ({ metadata, file }) => { metadata; file.customId; }), } satisfies FileRouter; Does anybody know what I am missing here?
return { foo: "bar" as const, [UTFiles]: fileOverrides }; }) .onUploadComplete(async ({ metadata, file }) => { metadata; file.customId; }), } satisfies FileRouter; Does anybody know what I am missing here?
2 replies