Skip to content

Commit

Permalink
fix: use identity token for orb clubs
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoginth committed Sep 5, 2024
1 parent 31494fe commit a9a14de
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion apps/api/src/routes/clubs/join.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const post = [
'App-Access-Token': CLUBS_APP_TOKEN,
'Content-Type': 'application/json',
'User-Agent': HEY_USER_AGENT,
'X-Access-Token': identityToken
'X-Identity-Token': identityToken
},
method: 'POST'
});
Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/routes/clubs/leave.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const post = [
'App-Access-Token': CLUBS_APP_TOKEN,
'Content-Type': 'application/json',
'User-Agent': HEY_USER_AGENT,
'X-Access-Token': identityToken
'X-Identity-Token': identityToken
},
method: 'POST'
});
Expand Down
4 changes: 1 addition & 3 deletions apps/api/src/routes/clubs/members.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,12 @@ export const post: Handler = async (req, res) => {
}

try {
const identityToken = req.headers['x-identity-token'] as string;
const response = await fetch(`${CLUBS_API_URL}/fetch-club-members`, {
body: JSON.stringify(body),
headers: {
'App-Access-Token': CLUBS_APP_TOKEN,
'Content-Type': 'application/json',
'User-Agent': HEY_USER_AGENT,
'X-Access-Token': identityToken
'User-Agent': HEY_USER_AGENT
},
method: 'POST'
});
Expand Down
10 changes: 4 additions & 6 deletions apps/web/src/components/Club/Members.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type { FC } from 'react';

import ProfileListShimmer from '@components/Shared/Shimmer/ProfileListShimmer';
import UserProfile from '@components/Shared/UserProfile';
import { getAuthApiHeaders } from '@helpers/getAuthApiHeaders';
import { ArrowLeftIcon, UsersIcon } from '@heroicons/react/24/outline';
import { HEY_API_URL } from '@hey/data/constants';
import { ProfileLinkSource } from '@hey/data/tracking';
Expand Down Expand Up @@ -31,11 +30,10 @@ const Members: FC<MembersProps> = ({ clubId, handle }) => {
};
} | null> => {
try {
const response = await axios.post(
`${HEY_API_URL}/clubs/members`,
{ id: clubId, limit: 50 },
{ headers: getAuthApiHeaders() }
);
const response = await axios.post(`${HEY_API_URL}/clubs/members`, {
id: clubId,
limit: 50
});

return response.data.data;
} catch {
Expand Down

0 comments on commit a9a14de

Please sign in to comment.