Update index.js

Kar 2024-03-15 08:25:33 +00:00
parent 84c8f0b638
commit 1e6da9c7c1
1 changed files with 4 additions and 3 deletions

View File

@ -11,8 +11,9 @@ let port = process.env.PORT || 5000;
app.get('/*', (req, res, next) => {
try {
const token = req.query.access_token;
var public_key = fs.readFileSync('id_rsa.pub');
const verified = jwt.verify(token, public_key, { algorithms: 'RS512'});
// var public_key = fs.readFileSync('id_rsa.pub');
// const verified = jwt.verify(token, public_key, { algorithms: 'RS512'});
const verified = jwt.verify(token, process.env.TOKEN_HEADER_KEY);
if(verified){
var path = require('path');
let file = req.params[0];