mirror of
https://github.com/timvisee/send.git
synced 2025-10-04 01:59:16 +02:00
added hmac auth to report route
This commit is contained in:
parent
2f6119e2f1
commit
d9cbe058ab
7 changed files with 39 additions and 50 deletions
|
@ -1,6 +1,5 @@
|
|||
import FileSender from './fileSender';
|
||||
import FileReceiver from './fileReceiver';
|
||||
import { reportLink } from './api';
|
||||
import { copyToClipboard, delay, openLinksInNewTab, percent } from './utils';
|
||||
import * as metrics from './metrics';
|
||||
import { bytes, locale } from './utils';
|
||||
|
@ -315,13 +314,7 @@ export default function(state, emitter) {
|
|||
|
||||
emitter.on('report', async ({ reason }) => {
|
||||
try {
|
||||
const file = state.fileInfo;
|
||||
if (!file) {
|
||||
// TODO
|
||||
emitter.emit('pushState', '/error');
|
||||
return render();
|
||||
}
|
||||
await reportLink(file.id, file.secretKey, reason);
|
||||
await state.transfer.reportLink(reason);
|
||||
render();
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue