Skip to content

Commit

Permalink
fix : added token in payload
Browse files Browse the repository at this point in the history
  • Loading branch information
Vswaroop04 committed Jul 12, 2024
1 parent d8c21ff commit a19a741
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion client/src/Components/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ export default function Home() {
if (currentToken) {
const repoSub = await subscribeRepoPostReq(
accessToken,
repo
repo,
currentToken
);
if (!repoSub.ok) {
toast.error("Error Subscribing to Repo");
Expand Down
8 changes: 6 additions & 2 deletions client/src/fetchers/subscribeRepo.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
export async function subscribeRepoPostReq(accessToken: string, repoLink: string) {
export async function subscribeRepoPostReq(
accessToken: string,
repoLink: string,
currentToken: string
) {
try {
const response = await fetch(
`${import.meta.env.VITE_SERVER}/subscribeRepo`,
Expand All @@ -8,7 +12,7 @@ export async function subscribeRepoPostReq(accessToken: string, repoLink: string
"Content-Type": "application/json",
Authorization: accessToken,
},
body: JSON.stringify({ repoLink }),
body: JSON.stringify({ repoLink, token: currentToken }),
}
);
const data = await response.json();
Expand Down
2 changes: 1 addition & 1 deletion server/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

.env

/src/utils/github-chrome-extension-firebase-adminsdk
/src/utils/github-chrome-extension-firebase-adminsdk.json

0 comments on commit a19a741

Please sign in to comment.