Skip to content

Commit

Permalink
fix: pass auth token on /cameras route to recognize endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
jakowenko committed Sep 20, 2021
1 parent d25c1fd commit 2e940bf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/src/controllers/cameras.controller.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const axios = require('axios');
const { SERVER, CAMERAS } = require('../constants');
const { jwt } = require('../util/auth.util');
const { AUTH, SERVER, CAMERAS } = require('../constants');
const { BAD_REQUEST } = require('../constants/http-status');

module.exports.event = async (req, res) => {
Expand All @@ -24,6 +25,7 @@ module.exports.event = async (req, res) => {
const { data } = await axios({
method: 'get',
url: `http://0.0.0.0:${SERVER.PORT}/api/recognize`,
headers: AUTH ? { authorization: jwt.sign({ route: 'recognize' }) } : null,
params: {
url: `${SNAPSHOT.URL}`,
type: 'camera-event',
Expand Down

0 comments on commit 2e940bf

Please sign in to comment.