Implemented FxA

This commit is contained in:
Danny Coates 2018-08-07 15:40:17 -07:00
parent 70bc2b7656
commit 718d74fa50
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
40 changed files with 1306 additions and 651 deletions

View file

@ -1,4 +1,4 @@
/* global DEFAULT_EXPIRE_SECONDS */
/* global DEFAULTS */
import Nanobus from 'nanobus';
import OwnedFile from './ownedFile';
import Keychain from './keychain';
@ -7,9 +7,10 @@ import { uploadWs } from './api';
import { encryptedSize } from './ece';
export default class FileSender extends Nanobus {
constructor(file, timeLimit) {
constructor(file, timeLimit, bearerToken) {
super('FileSender');
this.timeLimit = timeLimit || DEFAULT_EXPIRE_SECONDS;
this.timeLimit = timeLimit || DEFAULTS.EXPIRE_SECONDS;
this.bearerToken = bearerToken;
this.file = file;
this.keychain = new Keychain();
this.reset();
@ -75,11 +76,12 @@ export default class FileSender extends Nanobus {
encStream,
metadata,
authKeyB64,
this.timeLimit,
this.bearerToken,
p => {
this.progress = [p, totalSize];
this.emit('progress');
},
this.timeLimit
}
);
if (this.cancelled) {