mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
Github Oauth,支持自动转换config.ini配置
This commit is contained in:
1 parent
5707f973d7
commit
8476eac3b4
17 files changed
+240
-109
No files matched your search
+2
-1
@@ -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)) {
|
||||
|
||||
Reference in new issue
Block a user