Skip to content
This repository was archived by the owner on Feb 7, 2025. It is now read-only.

Commit 04540df

Browse files
committed
remove password requirement for createUser method
resolves soumak77#108
1 parent 43999d3 commit 04540df

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/firebase-auth.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,7 @@ FirebaseAuth.prototype.createUserWithEmailAndPassword = function (email, passwor
258258

259259
FirebaseAuth.prototype.createUser = function (credentials, onComplete) {
260260
validateCredentials('createUser', credentials, [
261-
'email',
262-
'password'
261+
'email'
263262
]);
264263
return this._createUser('createUser', credentials, onComplete);
265264
};

test/unit/auth.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ describe('Auth', function () {
7979
it('gets a copy of the user by email', function () {
8080
ref.createUser({
8181
uid: 'bd',
82-
email: 'ben@example.com',
83-
password: '123'
82+
email: 'ben@example.com'
8483
});
8584
var found = ref.getUserByEmail('ben@example.com');
8685
return Promise.all([
@@ -331,6 +330,16 @@ describe('Auth', function () {
331330
});
332331
});
333332

333+
it('creates a new user without a password', function () {
334+
ref.createUser({
335+
email: 'new1@new1.com'
336+
}, spy);
337+
ref.flush();
338+
expect(spy).to.have.been.calledWithMatch(null, {
339+
uid: 'simplelogin:1'
340+
});
341+
});
342+
334343
it('creates a new user and returns promise', function (done) {
335344
var promise = ref.createUser({
336345
email: 'new1@new1.com',
@@ -394,14 +403,6 @@ describe('Auth', function () {
394403
.to.throw('must contain the key "email"');
395404
});
396405

397-
it('fails if password is not a string', function () {
398-
expect(ref.createUser.bind(ref, {
399-
email: 'email@domain.com',
400-
password: true
401-
}))
402-
.to.throw('must contain the key "password"');
403-
});
404-
405406
it('fails if user already exists', function () {
406407
ref.createUser({
407408
email: 'duplicate@dup.com',

0 commit comments

Comments
 (0)