-
Notifications
You must be signed in to change notification settings - Fork 100
/
Copy pathlogout.html
35 lines (30 loc) · 1008 Bytes
/
logout.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<meta charset="UTF-8" />
<meta content="width=device-width,initial-scale=1" name="viewport" />
<script>
UPLOADCARE_PUBLIC_KEY = 'demopublickey' // should be replaced
UPLOADCARE_TABS = 'all'
UPLOADCARE_DEBUG_UPLOADS = true
UPLOADCARE_SOCIAL_BASE = 'https://social.uploadcare.com'
UPLOADCARE_CDN_BASE = 'https://ucarecdn.com'
UPLOADCARE_URL_BASE = 'https://upload.uploadcare.com'
</script>
<script src="./uploadcare.full.js"></script>
<input id="key" />
<button id="logout">switch</button>
<script>
function switchKey() {
const $ = uploadcare.jQuery
const key = $('#key').val()
document.querySelector('#uploader')?.remove()
document.querySelector('.uploadcare--widget')?.remove()
$('<input type="hidden" id="uploader" preview-step="" />').appendTo(
document.body
)
const widget1 = uploadcare.Widget('#uploader', {
remoteTabSessionKey: key
})
}
document.querySelector('#logout').addEventListener('click', () => {
switchKey()
})
</script>