fix encoding user credentials
This commit is contained in:
parent
e2a3f0b6fa
commit
7cc540b6fd
1 changed files with 2 additions and 1 deletions
|
|
@ -100,7 +100,8 @@ async function req(url, opts = {}, { user_id = "", secret = "" }, data = null) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (secret) {
|
if (secret) {
|
||||||
opts.headers["Authorization"] = `Bearer ${user_id} ${secret}`
|
const credentials = btoa(`${user_id}:${secret}`)
|
||||||
|
opts.headers["Authorization"] = `Basic ${credentials}`
|
||||||
opts.mode = "cors"
|
opts.mode = "cors"
|
||||||
opts.credentials = "include"
|
opts.credentials = "include"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue