Mike
Mike
TTCTheo's Typesafe Cult
Created by Mike on 2/11/2024 in #questions
Embedding T3 + Clerk in another site via iframe (error: uat-missing)
Hi, I'm trying to embed a T3 + Clerk site in another page via iframe, but I'm running into issues with Clerk. Looking at the debug, it looks like Clerk is refusing to give cookies to the embedded version of the site. Any ideas on what I might be doing wrong would be greatly appreciated. I've been stuck on this all day (I'm new to Next/T3). middleware.ts
import { authMiddleware } from "@clerk/nextjs";

export default authMiddleware({
publicRoutes: ["/", "/api/trpc/post.getLatest"],
beforeAuth(req, evt) {
console.log('\n\n\n\Request', req, '\n\n\nEnd Request\n\n\n')
},
debug: true,
});

export const config = {
matcher: ["/((?!.+\\.[\\w]+$|_next).*)", "/", "/(api|trpc)(.*)"],
};
import { authMiddleware } from "@clerk/nextjs";

export default authMiddleware({
publicRoutes: ["/", "/api/trpc/post.getLatest"],
beforeAuth(req, evt) {
console.log('\n\n\n\Request', req, '\n\n\nEnd Request\n\n\n')
},
debug: true,
});

export const config = {
matcher: ["/((?!.+\\.[\\w]+$|_next).*)", "/", "/(api|trpc)(.*)"],
};
Request / Debug output https://pastebin.com/raw/Q9xEnFty server.ts https://pastebin.com/wC8Urcqf
3 replies