Widget and demo changes
This commit is contained in:
+10
-10
@@ -1,12 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Cap demo</title>
|
||||
</head>
|
||||
<body>
|
||||
<cap-widget id="cap" data-api-endpoint="/api/"></cap-widget>
|
||||
</body>
|
||||
<script src="https://cdn.jsdelivr.net/npm/@cap.js/widget"></script>
|
||||
</html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Cap demo</title>
|
||||
</head>
|
||||
<body>
|
||||
<cap-widget id="cap" data-api-endpoint="/api/"></cap-widget>
|
||||
</body>
|
||||
<script src="https://raw.githubusercontent.com/tiagorangel1/cap/refs/heads/main/widget/cap.min.js"></script>
|
||||
</html>
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@cap.js/widget",
|
||||
"version": "0.0.5",
|
||||
"version": "0.0.6",
|
||||
"description": "Cap widget",
|
||||
"keywords": [
|
||||
"captcha",
|
||||
|
||||
+3
-6
@@ -50,14 +50,11 @@
|
||||
|
||||
try {
|
||||
// MARK: Todo
|
||||
const apiEndpoint =
|
||||
location.hostname === "localhost"
|
||||
? "/api/"
|
||||
: this.#el.getAttribute("cap-api-endpoint");
|
||||
const apiEndpoint = this.#el.getAttribute("cap-api-endpoint");
|
||||
|
||||
const { challenge, target, token } = await (
|
||||
await fetch(
|
||||
`${apiEndpoint || "https://trycap.glitch.me/api/"}challenge`,
|
||||
`${apiEndpoint}challenge`,
|
||||
{
|
||||
method: "POST",
|
||||
}
|
||||
@@ -71,7 +68,7 @@
|
||||
|
||||
const resp = await (
|
||||
await fetch(
|
||||
`${apiEndpoint || "https://trycap.glitch.me/api/"}redeem`,
|
||||
`${apiEndpoint}redeem`,
|
||||
{
|
||||
method: "POST",
|
||||
body: JSON.stringify({ token, solutions }),
|
||||
|
||||
Reference in New Issue
Block a user