mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Catch authentication error
This commit is contained in:
parent
576318fcbe
commit
a1171c7952
1 changed files with 7 additions and 2 deletions
|
|
@ -22,8 +22,13 @@ export function speechServiceRouter() {
|
|||
body: req.body,
|
||||
})
|
||||
const token = req.query.token as string
|
||||
if (!(await getClaimsByToken(token))) {
|
||||
logger.info('Unauthorized request', { token })
|
||||
try {
|
||||
if (!(await getClaimsByToken(token))) {
|
||||
logger.info('Unauthorized request', { token })
|
||||
return res.status(200).send('UNAUTHORIZED')
|
||||
}
|
||||
} catch (error) {
|
||||
logger.error('Unauthorized request', { token, error })
|
||||
return res.status(200).send('UNAUTHORIZED')
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue