Skip to content

Commit

Permalink
proxy true for orcid auth
Browse files Browse the repository at this point in the history
  • Loading branch information
Rashmi-278 committed Feb 3, 2023
1 parent b37dd5c commit 96f62ad
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/@context/Dataset.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function DatasetProvider({
const authors = await resp.json()
return authors
} catch (err) {
console.log(err)
console.error(err)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/@shared/atoms/Alert/index.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ Full.args = {
},
badge: 'Hello',
onDismiss: () => {
console.log('Alert closed!')
console.error('Alert closed!')
}
}
7 changes: 4 additions & 3 deletions src/lib/passport.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ const Strategy = new OrcidStrategy(
state: false, // remove this if not using sessions
clientID: process.env.NEXT_PUBLIC_ORCID_CLIENT_ID,
clientSecret: process.env.NEXT_PUBLIC_ORCID_CLIENT_SECRET,
callbackURL: '/api/orcid/callback'
callbackURL: '/api/orcid/callback',
proxy: true // required to enforce https
},
async (accessToken, refreshToken, params, profile, done) => {
try {
Expand Down Expand Up @@ -48,8 +49,8 @@ const Strategy = new OrcidStrategy(
},
process.env.NEXT_PUBLIC_JWT_SECRET
)
obj.tokens.pop();
console.log("popped")
obj.tokens.pop()
console.log('popped')
obj.tokens.push(token)
await obj.save()
done(null, obj, { message: 'Auth successful', token })
Expand Down

1 comment on commit 96f62ad

@vercel
Copy link

@vercel vercel bot commented on 96f62ad Feb 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.