Spaces:
Runtime error
Runtime error
Create oauth_redirect.html
Browse files- oauth_redirect.html +30 -0
oauth_redirect.html
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html>
|
| 3 |
+
<head>
|
| 4 |
+
<title>Autorizando...</title>
|
| 5 |
+
<script>
|
| 6 |
+
(function() {
|
| 7 |
+
// Extrae el c贸digo de autorizaci贸n de la URL
|
| 8 |
+
const urlParams = new URLSearchParams(window.location.search);
|
| 9 |
+
const code = urlParams.get('code');
|
| 10 |
+
|
| 11 |
+
if (code) {
|
| 12 |
+
// Env铆a el c贸digo a tu servidor local
|
| 13 |
+
fetch('http://localhost:7860/oauth_callback?code=' + code)
|
| 14 |
+
.then(response => response.text())
|
| 15 |
+
.then(data => {
|
| 16 |
+
console.log('Token recibido, cerrando ventana...');
|
| 17 |
+
window.close();
|
| 18 |
+
})
|
| 19 |
+
.catch(err => console.error('Error:', err));
|
| 20 |
+
} else {
|
| 21 |
+
document.body.innerHTML = '<h1>Error: No se recibi贸 c贸digo de autorizaci贸n.</h1>';
|
| 22 |
+
}
|
| 23 |
+
})();
|
| 24 |
+
</script>
|
| 25 |
+
</head>
|
| 26 |
+
<body>
|
| 27 |
+
<h1>Autorizando con GitHub...</h1>
|
| 28 |
+
<p>Por favor, espera mientras se completa la autenticaci贸n. Esta ventana se cerrar谩 autom谩ticamente.</p>
|
| 29 |
+
</body>
|
| 30 |
+
</html>
|