Skip to content

Commit 8479aa7

Browse files
committed
update localcloudprovider
1 parent 560dc13 commit 8479aa7

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

Diff for: libs/cloud-providers/LocalCloudProvider.js

+11-9
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,21 @@ const AbstractCloudProvider = require('../classes/AbstractCloudProvider');
1919

2020
module.exports = class LocalCloudProvider extends AbstractCloudProvider{
2121
constructor(){
22-
super();
22+
super(token);
23+
24+
this.token = token;
2325
}
2426

2527
// Validate token
2628
async validate(token){
27-
if (!token) return {error: "Invalid token"
28-
}else{
29-
return {
30-
valid: true,
31-
limits: [] // No limits
32-
};
33-
}
34-
}
29+
if (this.token === token){
30+
return cb(null, true);
31+
}else{
32+
cb(new Error("token does not match."), false);
33+
}
34+
35+
}
36+
};
3537

3638
// Always approve
3739
async approveNewTask(token, imagesCount){

0 commit comments

Comments
 (0)