Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ember-cli-simple-auth-firebase

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-cli-simple-auth-firebase - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

app/initializers/firebase-auth.js

87

app/authenticators/firebase.js

@@ -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"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc