Skip to content

Commit

Permalink
fix: pass params properly
Browse files Browse the repository at this point in the history
  • Loading branch information
oreHGA authored Apr 7, 2024
1 parent 351be18 commit caae527
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 3 additions & 0 deletions frontend/src/hooks/useNeurosityState/useNeurosityState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ export function useNeurosityState() {
headers: {
Authorization: `Bearer ${sessionData?.user?.authToken}`,
},
params: {
redirectUri: window.location.origin + "/neurosity-callback",
}
});
console.log("Got response from API");

Expand Down
3 changes: 1 addition & 2 deletions server/controllers/neurosity.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ const neurosity = new Neurosity({
});

exports.generateOAuthURL = async (req, res) => {
const redirectUri = `${req.hostname}/neurosity-callback`;

await neurosity
.createOAuthURL({
clientId: process.env.NEUROSITY_OAUTH_CLIENT_ID,
clientSecret: process.env.NEUROSITY_OAUTH_CLIENT_SECRET,
redirectUri: redirectUri,
redirectUri: req.params.redirectUri,
responseType: "token",
state: Math.random().toString().split(".")[1], // A random string is required for security reasons
scope: [
Expand Down

0 comments on commit caae527

Please sign in to comment.