aboutsummaryrefslogtreecommitdiff
path: root/server/src/routes/ui/style/playerconf-copy-url.js
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2023-09-24 16:43:21 +0200
committermetamuffin <metamuffin@disroot.org>2023-09-24 16:43:21 +0200
commit327fb4d66096744fdc58bfaf7ea570cc976390e8 (patch)
tree2023f0300194ed0992d6917b2787c9a7d883b03c /server/src/routes/ui/style/playerconf-copy-url.js
parent35b370e6d4b4fcfbe9ce63fa20cfe97333a3a93b (diff)
downloadjellything-327fb4d66096744fdc58bfaf7ea570cc976390e8.tar
jellything-327fb4d66096744fdc58bfaf7ea570cc976390e8.tar.bz2
jellything-327fb4d66096744fdc58bfaf7ea570cc976390e8.tar.zst
include session token in copied url
Diffstat (limited to 'server/src/routes/ui/style/playerconf-copy-url.js')
-rw-r--r--server/src/routes/ui/style/playerconf-copy-url.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/server/src/routes/ui/style/playerconf-copy-url.js b/server/src/routes/ui/style/playerconf-copy-url.js
index 0145bd5..49f27fd 100644
--- a/server/src/routes/ui/style/playerconf-copy-url.js
+++ b/server/src/routes/ui/style/playerconf-copy-url.js
@@ -20,10 +20,11 @@ function patch_playerconf(form) {
copyurl.style.width = "5em"
copyurl.addEventListener("click", ev => {
+ const session = document.cookie.split(";").map(e => e.trim().split("=")).find(e => e[0] == "session")[1]
ev.preventDefault()
const fd = new FormData(form)
const sp = ["v", "a", "s"].map(k => fd.get(k)).filter(k => k != "").flat()
- const url = `${window.location.protocol}//${window.location.host}/n/${window.location.pathname.split("/")[2]}/stream?tracks=${sp}`
+ const url = `${window.location.protocol}//${window.location.host}/n/${window.location.pathname.split("/")[2]}/stream?tracks=${sp}&session=${session}`
navigator.clipboard.writeText(url)
copyurl.textContent = "Copied"
setTimeout(() => copyurl.textContent = "Copy Stream URL", 1000)