🐛 Fix allowed origins when embedded in iframe

Closes #1518
This commit is contained in:
Baptiste Arnaud
2024-06-19 09:54:08 +02:00
parent 36c984643a
commit 67f37c02a4
9 changed files with 874 additions and 27 deletions

View File

@@ -29,6 +29,7 @@ import {
defaultFontType,
defaultProgressBarPosition,
} from '@typebot.io/schemas/features/typebot/theme/constants'
import { CorsError } from '@/utils/CorsError'
export type BotProps = {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -106,6 +107,10 @@ export const Bot = (props: BotProps & { class?: string }) => {
)
}
if (error instanceof CorsError) {
return setError(new Error(error.message))
}
if (!data) {
if (error) {
console.error(error)