Skip to content

Commit 581f2fd

Browse files
committed
#2259 add button to copy jwt into clipboard
1 parent bfc3395 commit 581f2fd

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

Console/BExIS.Web.Shell/Views/Tokens/Read.cshtml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,22 @@
44
ViewBag.Title = "Token";
55
}
66

7+
<script>
8+
function myFunction() {
9+
const text = @Html.Raw(Json.Encode(Model.Jwt));
10+
navigator.clipboard.writeText(text)
11+
.then(() => {
12+
alert('JWT copied to clipboard!');
13+
})
14+
.catch(err => {
15+
alert('Error copying JWT: ' + err);
16+
});
17+
}
18+
</script>
19+
720
<div class="col-md-6" style="word-wrap: break-word">
821
@Html.LabelFor(m => m.Jwt)
922
@Html.DisplayFor(m => m.Jwt)
10-
</div>
23+
<button id="jwt-copy" class="bx bx-copy" onclick="myFunction()">Copy</button>
24+
</div>
25+

0 commit comments

Comments
 (0)