From 94608a075427737ffbd949860b353f4187bf144b Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Tue, 20 Jun 2017 13:02:20 +0200 Subject: [PATCH] Implemented authorization --- pages/profile/profile.pixy | 4 ++-- scripts/actions.ts | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pages/profile/profile.pixy b/pages/profile/profile.pixy index 2e93e19f..2800eab1 100644 --- a/pages/profile/profile.pixy +++ b/pages/profile/profile.pixy @@ -1,4 +1,4 @@ -component ProfileHeader(viewUser *arn.User, user *arn.User, animeList *arn.AnimeList, threads []*arn.Thread) +component ProfileHeader(viewUser *arn.User, user *arn.User) .profile img.profile-cover(src=viewUser.CoverImageURL(), alt="Cover image") @@ -45,7 +45,7 @@ component ProfileHeader(viewUser *arn.User, user *arn.User, animeList *arn.Anime span= arn.Capitalize(viewUser.Role) component Profile(viewUser *arn.User, user *arn.User, animeList *arn.AnimeList, threads []*arn.Thread) - ProfileHeader(viewUser, user, animeList, threads) + ProfileHeader(viewUser, user) .profile-category h3 diff --git a/scripts/actions.ts b/scripts/actions.ts index fee6bec2..a43b3aa9 100644 --- a/scripts/actions.ts +++ b/scripts/actions.ts @@ -10,7 +10,8 @@ export function addAnimeToCollection(arn: AnimeNotifier, button: HTMLElement) { fetch("/api/animelist/" + userId + "/add", { method: "POST", - body: animeId + body: animeId, + credentials: 'same-origin' }) .then(response => response.text()) .then(body => { @@ -33,7 +34,8 @@ export function removeAnimeFromCollection(arn: AnimeNotifier, button: HTMLElemen fetch("/api/animelist/" + userId + "/remove", { method: "POST", - body: animeId + body: animeId, + credentials: 'same-origin' }) .then(response => response.text()) .then(body => {