2024-03-23 14:44:05 +05:30
|
|
|
import { cleanUrl } from "~/libs/clean-url"
|
2024-03-09 18:43:39 +05:30
|
|
|
|
|
|
|
|
export const verifyPageShareURL = async (url: string) => {
|
|
|
|
|
const res = await fetch(`${cleanUrl(url)}/api/v1/ping`)
|
|
|
|
|
if (!res.ok) {
|
|
|
|
|
throw new Error("Unable to verify page share")
|
|
|
|
|
}
|
|
|
|
|
const data = await res.text()
|
|
|
|
|
return data === "pong"
|
|
|
|
|
}
|