build: 🏗️ Add Sentry to builder
This commit is contained in:
@ -7,6 +7,7 @@ import { stringify } from 'querystring'
|
||||
import { CredentialsType } from 'models'
|
||||
import { encrypt } from 'utils'
|
||||
import { oauth2Client } from 'libs/google-sheets'
|
||||
import { withSentry } from '@sentry/nextjs'
|
||||
|
||||
const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
const session = await getSession({ req })
|
||||
@ -57,10 +58,10 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
},
|
||||
})
|
||||
const queryParams = stringify({ stepId, credentialsId })
|
||||
return res.redirect(
|
||||
res.redirect(
|
||||
`${redirectUrl}?${queryParams}` ?? `${process.env.NEXTAUTH_URL}`
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default handler
|
||||
export default withSentry(handler)
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { withSentry } from '@sentry/nextjs'
|
||||
import { oauth2Client } from 'libs/google-sheets'
|
||||
import { NextApiRequest, NextApiResponse } from 'next'
|
||||
|
||||
@ -15,8 +16,8 @@ const handler = (req: NextApiRequest, res: NextApiResponse) => {
|
||||
prompt: 'consent',
|
||||
state: Buffer.from(JSON.stringify(req.query)).toString('base64'),
|
||||
})
|
||||
return res.status(301).redirect(url)
|
||||
res.status(301).redirect(url)
|
||||
}
|
||||
}
|
||||
|
||||
export default handler
|
||||
export default withSentry(handler)
|
||||
|
Reference in New Issue
Block a user