Fixing remote auth optional depencies error (#1640)
Co-authored-by: Rajeh Taher <rajeh@reforward.dev>
This commit is contained in:
parent
537e843a49
commit
ab7ee0eb4f
1 changed files with 5 additions and 2 deletions
|
|
@ -6,7 +6,9 @@ try {
|
|||
var unzipper = require('unzipper');
|
||||
var archiver = require('archiver');
|
||||
} catch {
|
||||
throw new Error('Optional Dependencies [fs-extra, unzipper, archiver] are required to use RemoteAuth. Make sure to run npm install correctly and remove the --no-optional flag');
|
||||
fs = undefined;
|
||||
unzipper = undefined;
|
||||
archiver = undefined;
|
||||
}
|
||||
|
||||
const path = require('path');
|
||||
|
|
@ -23,6 +25,7 @@ const BaseAuthStrategy = require('./BaseAuthStrategy');
|
|||
*/
|
||||
class RemoteAuth extends BaseAuthStrategy {
|
||||
constructor({ clientId, dataPath, store, backupSyncIntervalMs } = {}) {
|
||||
if (!fs && !unzipper && !archiver) throw new Error('Optional Dependencies [fs-extra, unzipper, archiver] are required to use RemoteAuth. Make sure to run npm install correctly and remove the --no-optional flag');
|
||||
super();
|
||||
|
||||
const idRegex = /^[-_\w]+$/i;
|
||||
|
|
@ -198,4 +201,4 @@ class RemoteAuth extends BaseAuthStrategy {
|
|||
}
|
||||
}
|
||||
|
||||
module.exports = RemoteAuth;
|
||||
module.exports = RemoteAuth;
|
||||
|
|
|
|||
Loading…
Reference in a new issue