|
85 | 85 | --bs-nav-pills-link-active-bg: var(--main-color); |
86 | 86 | --bs-link-hover-color: var(--main-color); |
87 | 87 | } |
| 88 | + .hover-text:hover { |
| 89 | + cursor: pointer; /* Cambia el icono del mouse a un click */ |
| 90 | + text-decoration: underline; /* Subraya el texto */ |
| 91 | + color: #8fdf6c; |
| 92 | + } |
88 | 93 | </style> |
89 | 94 | </head> |
90 | 95 | <body> |
|
155 | 160 | </tr> |
156 | 161 | </thead> |
157 | 162 | <tbody> |
158 | | - <tr><td style='word-break:break-word;white-space:pre-wrap;-moz-white-space:pre-wrap;'>{{access_token}}</td></tr> |
| 163 | + <tr><td style='word-break:break-word;white-space:pre-wrap;-moz-white-space:pre-wrap;' onclick="copyTextToClipboard(this)" class="hover-text">{{access_token}}</td></tr> |
159 | 164 | <tr id="accessTokenSecondRow"><td>View in <a href='https://jwt.io/#token={{access_token}}' target='_blank'>https://jwt.io/</a></td></tr> |
160 | 165 | </tbody> |
161 | 166 | </table> |
|
168 | 173 | </tr> |
169 | 174 | </thead> |
170 | 175 | <tbody> |
171 | | - <tr><td style='word-break:break-word;white-space:pre-wrap;-moz-white-space:pre-wrap;'>{{refresh_token}}</td></tr> |
| 176 | + <tr><td style='word-break:break-word;white-space:pre-wrap;-moz-white-space:pre-wrap;' onclick="copyTextToClipboard(this)" class="hover-text">{{refresh_token}}</td></tr> |
172 | 177 | <tr id="refreshTokenSecondRow"><td>View in <a href='https://jwt.io/#token={{refresh_token}}' target='_blank'>https://jwt.io/</a></td></tr> |
173 | 178 | </tbody> |
174 | 179 | </table> |
|
244 | 249 | if (refreshToken === "Not Provided in token endpoint response") { |
245 | 250 | document.getElementById("refreshTokenSecondRow").style.display = "none"; |
246 | 251 | } |
| 252 | + |
| 253 | + function copyTextToClipboard(input) { |
| 254 | + //* Solo funciona con HTTPS |
| 255 | + // let copyText = input.textContent || input.innerText; |
| 256 | + // navigator.clipboard.writeText(copyText) |
| 257 | + |
| 258 | + //* Para HTTP |
| 259 | + let copyText = input.textContent || input.innerText; |
| 260 | + let tempInput = document.createElement("textarea"); |
| 261 | + tempInput.value = copyText; |
| 262 | + document.body.appendChild(tempInput); |
| 263 | + |
| 264 | + // Seleccionar el texto dentro del campo temporal |
| 265 | + tempInput.select(); |
| 266 | + // Ejecutar el comando de copiar |
| 267 | + document.execCommand("copy"); |
| 268 | + // Remover el campo temporal |
| 269 | + document.body.removeChild(tempInput); |
| 270 | + } |
247 | 271 | </script> |
248 | 272 | </body> |
249 | 273 | </html> |
0 commit comments