Skip to content

Commit

Permalink
fix: remove extra try/catch block
Browse files Browse the repository at this point in the history
  • Loading branch information
DominusKelvin committed Jul 6, 2023
1 parent 934454c commit 4153655
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,18 +147,14 @@ module.exports = function defineWishHook(sails) {
case 'google':
if (!idToken) throw Error(`${idToken} is not a valid id_token`)
try {
try {
user = await sails.helpers.fetch(
`${sails.config.wish[provider].userUrl}&access_token=${accessToken}`,
{
headers: {
Authorization: `Bearer ${idToken}`,
},
}
)
} catch (error) {
throw error
}
user = await sails.helpers.fetch(
`${sails.config.wish[provider].userUrl}&access_token=${accessToken}`,
{
headers: {
Authorization: `Bearer ${idToken}`,
},
}
)
} catch (error) {
throw error
}
Expand Down

0 comments on commit 4153655

Please sign in to comment.