Update index.js
This commit is contained in:
5
index.js
5
index.js
@@ -11,8 +11,9 @@ let port = process.env.PORT || 5000;
|
|||||||
app.get('/*', (req, res, next) => {
|
app.get('/*', (req, res, next) => {
|
||||||
try {
|
try {
|
||||||
const token = req.query.access_token;
|
const token = req.query.access_token;
|
||||||
var public_key = fs.readFileSync('id_rsa.pub');
|
// var public_key = fs.readFileSync('id_rsa.pub');
|
||||||
const verified = jwt.verify(token, public_key, { algorithms: 'RS512'});
|
// const verified = jwt.verify(token, public_key, { algorithms: 'RS512'});
|
||||||
|
const verified = jwt.verify(token, process.env.TOKEN_HEADER_KEY);
|
||||||
if(verified){
|
if(verified){
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
let file = req.params[0];
|
let file = req.params[0];
|
||||||
|
|||||||
Reference in New Issue
Block a user