mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-07-04 20:11:45 +02:00
fix: copy the raw API token from the input value
The copy button passed the token through Django's escapejs filter into the hyperscript writeText() call, which turns every "-" into -. hyperscript does not decode \u escapes, so any token containing "-" (common with token_urlsafe) was copied corrupted and failed auth on paste. Copy from the input's value instead, which holds the unescaped raw token.
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
_="on focus call me.select()" />
|
||||
<button type="button"
|
||||
class="btn btn-sm btn-secondary join-item"
|
||||
_="on click call navigator.clipboard.writeText('{{ raw_token|escapejs }}')
|
||||
_="on click call navigator.clipboard.writeText(#raw-token-value.value)
|
||||
then put 'Copied!' into me
|
||||
then wait 1.5s
|
||||
then put 'Copy' into me">
|
||||
|
||||
Reference in New Issue
Block a user