Using correct cookie for credentials when fetching rsvps
This commit is contained in:
parent
026f0c9d2a
commit
a535d65b52
1 changed files with 3 additions and 3 deletions
|
|
@ -29,10 +29,10 @@ function createRsvpEntry(rsvp) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getRsvps() {
|
async function getRsvps() {
|
||||||
const token = Object.fromEntries(
|
const credentials = Object.fromEntries(
|
||||||
document.cookie.split(";").map((x) => x.trim().split("="))
|
document.cookie.split(";").map((x) => x.trim().split("="))
|
||||||
)['token']
|
)['credentials']
|
||||||
const resp = await fetch('/api/rsvps', { headers: { 'Authorization': `Basic ${String(btoa(token))}`} });
|
const resp = await fetch('/api/rsvps', { headers: { 'Authorization': `Basic ${String(btoa(credentials))}`} });
|
||||||
const rsvps = await resp.json()
|
const rsvps = await resp.json()
|
||||||
for (const rsvp of rsvps) {
|
for (const rsvp of rsvps) {
|
||||||
createRsvpEntry(rsvp);
|
createRsvpEntry(rsvp);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue