Skip to content

Commit 768b6fd

Browse files
authored
bug: friends list might be empty if its private (#37)
1 parent f8602aa commit 768b6fd

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/friends/friends.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class FriendsService {
1919
`https://api.steampowered.com/ISteamUser/GetFriendList/v1/?key=${this.steamApiKey}&steamid=${user.steam_id}`,
2020
);
2121
const { friendslist } = await response.json();
22-
const friends = friendslist.friends.map((friend: { steamid: string }) => {
22+
const friends = friendslist?.friends.map((friend: { steamid: string }) => {
2323
return friend.steamid;
2424
});
2525
const { players } = await this.hasura.query({

src/utilities/getCookieOptions.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ export function getCookieOptions(
3434
httpOnly: true,
3535
domain: process.env.AUTH_COOKIE_DOMAIN || `.${process.env.WEB_DOMAIN}`,
3636
maxAge: 14 * 24 * 60 * 60 * 1000,
37-
secure: process.env.SECURE_COOKIE ? process.env.SECURE_COOKIE === "true" : true,
37+
secure: process.env.SECURE_COOKIE
38+
? process.env.SECURE_COOKIE === "true"
39+
: true,
3840
},
3941
): CookieOptions {
4042
return Object.assign({}, defaultOptions, options);

0 commit comments

Comments
 (0)