File tree Expand file tree Collapse file tree 3 files changed +29
-2
lines changed Expand file tree Collapse file tree 3 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -385,6 +385,13 @@ return /******/ (function(modules) { // webpackBootstrap
385
385
} , settings ) ;
386
386
}
387
387
388
+ function _authAnonymously ( fn ) {
389
+ var ref = new Firebase ( '' + baseUrl ) ;
390
+ return ref . authAnonymously ( function ( error , authData ) {
391
+ return fn ( error , authData ) ;
392
+ } ) ;
393
+ }
394
+
388
395
function _onAuth ( fn ) {
389
396
var ref = new Firebase ( '' + baseUrl ) ;
390
397
return ref . onAuth ( fn ) ;
@@ -474,6 +481,9 @@ return /******/ (function(modules) { // webpackBootstrap
474
481
authWithOAuthRedirect : function authWithOAuthRedirect ( provider , fn , settings ) {
475
482
return _authWithOAuthRedirect ( provider , fn , settings ) ;
476
483
} ,
484
+ authAnonymously : function authAnonymously ( fn ) {
485
+ return _authAnonymously ( fn ) ;
486
+ } ,
477
487
onAuth : function onAuth ( fn ) {
478
488
return _onAuth ( fn ) ;
479
489
} ,
Original file line number Diff line number Diff line change @@ -289,7 +289,7 @@ module.exports = (function(){
289
289
firebaseListeners = { } ;
290
290
} ;
291
291
292
- function _authWithPassword ( credentials , fn ) {
292
+ function _authWithPassword ( credentials , fn ) {
293
293
var ref = new Firebase ( `${ baseUrl } ` ) ;
294
294
return ref . authWithPassword ( credentials , function ( error , authData ) {
295
295
return fn ( error , authData ) ;
@@ -327,6 +327,13 @@ module.exports = (function(){
327
327
} , settings ) ;
328
328
}
329
329
330
+ function _authAnonymously ( fn ) {
331
+ var ref = new Firebase ( `${ baseUrl } ` ) ;
332
+ return ref . authAnonymously ( function ( error , authData ) {
333
+ return fn ( error , authData ) ;
334
+ } ) ;
335
+ }
336
+
330
337
function _onAuth ( fn ) {
331
338
var ref = new Firebase ( `${ baseUrl } ` ) ;
332
339
return ref . onAuth ( fn ) ;
@@ -416,6 +423,9 @@ module.exports = (function(){
416
423
authWithOAuthRedirect ( provider , fn , settings ) {
417
424
return _authWithOAuthRedirect ( provider , fn , settings ) ;
418
425
} ,
426
+ authAnonymously ( fn ) {
427
+ return _authAnonymously ( fn ) ;
428
+ } ,
419
429
onAuth ( fn ) {
420
430
return _onAuth ( fn ) ;
421
431
} ,
Original file line number Diff line number Diff line change @@ -976,7 +976,14 @@ describe('re-base Tests:', function(){
976
976
expect ( authData ) . not . toBeNull ( ) ;
977
977
done ( ) ;
978
978
} ) ;
979
- } ) ;
979
+ it ( 'can log in anonymously' , function ( done ) {
980
+ base . authAnonymously ( function ( error , authData ) {
981
+ expect ( error ) . not . toBeNull ( ) ;
982
+ expect ( authData ) . toBeUndefined ( ) ;
983
+ done ( ) ;
984
+ } ) ;
985
+ } ) ;
986
+ } ) ;
980
987
describe ( 'User tests' , function ( ) {
981
988
it ( 'Fails to create with invalid email' , function ( done ) {
982
989
base . createUser ( {
You can’t perform that action at this time.
0 commit comments