-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
79 lines (70 loc) · 2.33 KB
/
Copy pathindex.html
File metadata and controls
79 lines (70 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<!doctype html>
<html lang="es">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Autorización completada</title>
<style>
:root { color-scheme: light dark; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
max-width: 640px; margin: 0 auto; padding: 3rem 1.25rem; line-height: 1.6;
}
h1 { font-size: 1.4rem; margin-bottom: .25rem; }
.sub { opacity: .7; margin-top: 0; }
#box { margin-top: 2rem; }
code {
display: block; word-break: break-all; padding: 1rem;
border: 1px solid rgba(128,128,128,.4); border-radius: 8px;
font-size: .8rem; background: rgba(128,128,128,.08);
}
button {
margin-top: .75rem; padding: .6rem 1.1rem; font-size: 1rem; cursor: pointer;
border: 1px solid rgba(128,128,128,.5); border-radius: 8px;
background: transparent; color: inherit;
}
.note { font-size: .85rem; opacity: .65; margin-top: 2.5rem; }
.err { color: #c0392b; }
</style>
</head>
<body>
<h1>Autorización completada</h1>
<p class="sub">Ya podés volver a la terminal.</p>
<div id="box"></div>
<p class="note">
El código de abajo se lee de la barra de direcciones y se muestra únicamente en
tu navegador. Esta página es estática: no tiene servidor, no guarda nada y no
envía el código a ningún lado. Dura pocos minutos y sirve una sola vez.
</p>
<script>
(function () {
var box = document.getElementById("box");
var params = new URLSearchParams(window.location.search);
var code = params.get("code");
var error = params.get("error");
if (error) {
box.innerHTML = '<p class="err"><strong>eBay devolvió un error:</strong> ' +
error.replace(/[<>&]/g, "") + '</p>';
return;
}
if (!code) {
box.innerHTML = '<p class="err">No llegó ningún <code>code</code> en la URL. ' +
'Volvé a arrancar el flujo desde la terminal.</p>';
return;
}
var pre = document.createElement("code");
pre.textContent = code;
box.appendChild(pre);
var btn = document.createElement("button");
btn.textContent = "Copiar código";
btn.onclick = function () {
navigator.clipboard.writeText(code).then(function () {
btn.textContent = "Copiado ✓";
setTimeout(function () { btn.textContent = "Copiar código"; }, 2000);
});
};
box.appendChild(btn);
})();
</script>
</body>
</html>