Skip to content

Commit

Permalink
Fix Authorization header.
Browse files Browse the repository at this point in the history
  • Loading branch information
joestump committed Oct 20, 2024
1 parent 7776ade commit ada199e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pages/login/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const getServerSideProps: GetServerSideProps = async ({
headers: {
"Content-Type": "application/x-www-form-urlencoded",
Authorization: `Basic ${Buffer.from(
`${publicRuntimeConfig.REDDIUM_CLIENT_ID}:${serverRuntimeConfig.REDDIUM_CLIENT_SECRET}`
`${publicRuntimeConfig.REDDIUM_CLIENT_ID}:${publicRuntimeConfig.REDDIUM_CLIENT_SECRET}`
).toString("base64")}`,
},
body: new URLSearchParams({
Expand All @@ -30,7 +30,6 @@ export const getServerSideProps: GetServerSideProps = async ({
const resp = await (
await fetch("https://www.reddit.com/api/v1/access_token", requestOptions)
).json();
console.log("Received access token:", resp.access_token); // Debug output
cookies.set("token", resp.access_token, { maxAge: 600000 });
delete query.code;
} else {
Expand Down

0 comments on commit ada199e

Please sign in to comment.