Skip to content

Commit b5f8d8f

Browse files
authored
Update authorization header check for API key
1 parent 26fc875 commit b5f8d8f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

backend/src/server/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ app.use((req: any, res: any, next: any) => {
1919
})
2020

2121
app.use((req: any, res: any, next: any) => {
22-
if (!env.OM_API_KEY) return next()
22+
if (!env.api_key) return next()
2323
const h = req.headers['authorization'] || ''
24-
if (!h.startsWith('Bearer ') || h.slice(7) !== env.OM_API_KEY) {
24+
if (!h.startsWith('Bearer ') || h.slice(7) !== env.api_key) {
2525
return res.status(401).json({ err: 'auth' })
2626
}
2727
next()

0 commit comments

Comments
 (0)