ember-cli-simple-auth-firebase
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -7,60 +7,67 @@ import Base from 'simple-auth/authenticators/base'; | ||
init: function() { | ||
if(config.firebase) { | ||
this.set('firebase', new Firebase(config.firebase)); | ||
} else { | ||
throw new Error(new Error("'firebase' not defined in environment")); | ||
} | ||
init: function() { | ||
if (config.firebase) { | ||
this.set('firebase', new Firebase(config.firebase)); | ||
} else { | ||
throw new Error("'firebase' not defined in environment"); | ||
} | ||
this._super(); | ||
}, | ||
firebase: null, | ||
this._super(); | ||
}, | ||
firebase: null, | ||
restore: function(data) { | ||
return new Promise(function(resolve, reject) { | ||
var _this = this; | ||
return new Promise(function(resolve, reject) { | ||
if (data.token) { | ||
this.get('firebase').authWithCustomToken(data.token, function(error, success) { | ||
Ember.run(function() { | ||
if(error) { | ||
reject(error); | ||
} else { | ||
resolve(success); | ||
} | ||
}); | ||
}); | ||
_this.get('firebase').authWithCustomToken(data.token, function(error, success) { | ||
Ember.run(function() { | ||
if (error) { | ||
reject(error); | ||
} else { | ||
resolve(success); | ||
} | ||
}); | ||
}); | ||
} else { | ||
reject(new Error('Unable to restore Firebase session: no token found.')); | ||
reject(new Error('Unable to restore Firebase session: no token found.')); | ||
} | ||
}.bind(this)); | ||
}); | ||
}, | ||
authenticate: function(options) { | ||
var _this = this; | ||
return new Promise(function(resolve, reject) { | ||
this.get('firebase').authWithPassword({ | ||
'email': options.email, | ||
'password': options.password | ||
}, function(error, authData) { | ||
Ember.run(function() { | ||
if (error) { | ||
reject(error); | ||
} else { | ||
resolve(authData); | ||
} | ||
}); | ||
}); | ||
}.bind(this)); | ||
_this.get('firebase').authWithPassword({ | ||
'email': options.email, | ||
'password': options.password | ||
}, function(error, authData) { | ||
Ember.run(function() { | ||
if (error) { | ||
reject(error); | ||
} else { | ||
resolve(authData); | ||
} | ||
}); | ||
}); | ||
}); | ||
}, | ||
invalidate: function(data) { | ||
return new Promise(function(resolve, reject) { | ||
this.get('firebase').unauth(); | ||
resolve(data); | ||
}.bind(this)); | ||
var _this = this; | ||
return new Promise(function(resolve, reject) { | ||
_this.get('firebase').unauth(); | ||
resolve(data); | ||
}); | ||
} | ||
}); |
{ | ||
"name": "ember-cli-simple-auth-firebase", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Firebase Authenticator for Ember Simple Auth", | ||
@@ -14,3 +14,3 @@ "directories": { | ||
}, | ||
"repository": "", | ||
"repository": "https://github.com/jamesdixon/ember-cli-simple-auth-firebase", | ||
"engines": { | ||
@@ -17,0 +17,0 @@ "node": ">= 0.10.0" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
67
6058
7
2
0