Github Oauth,支持自动转换config.ini配置

This commit is contained in:
undefined committed 2020-06-21 13:37:55 +08:00
1 parent 5707f973d7
commit 8476eac3b4
17 files changed
+240 -109

No files matched your search

+2 -1
View File
@@ -1,5 +1,5 @@
const fs = require('fs');
const { ForbiddenError } = require('../error');
const { ForbiddenError, NotFoundError } = require('../error');
const db = require('../service/db');
const gridfs = require('../service/gridfs');
const hash = require('../lib/hash.hydro');
@@ -55,6 +55,7 @@ async function dec(_id) {
async function get(_id, secret) {
const file = await coll.findOne({ _id });
if (!file) throw new NotFoundError(_id);
if (typeof secret !== 'undefined') {
const timestamp = _timestamp();
if (!(hash(file.secret, timestamp.toString()) === secret)) {