How to use the angularfire2.AuthProviders.Password function in angularfire2

To help you get started, we’ve selected a few angularfire2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github joaogarin / angularfire2-firebase3-electron / src / app / components / home.spec.ts View on Github external
import { AngularFire, AngularFireModule, AuthProviders, AuthMethods } from 'angularfire2';

/**
 * Basic configuration like Endpoint URL's, API version..
 */
const options = require('./../config.json');

// Initialize Firebase
export const firebaseConfig = {
    apiKey: options.firebase.apiKey,
    authDomain: options.firebase.authDomain,
    databaseURL: options.firebase.databaseURL,
    storageBucket: options.firebase.storageBucket,
};
const firebaseAuthConfig = {
    provider: AuthProviders.Password,
    method: AuthMethods.Password,
};

describe('App component', () => {
    beforeEach(() => TestBed.configureTestingModule({
        imports: [
            FormsModule,
            ReactiveFormsModule,
            AngularFireModule.initializeApp(firebaseConfig, firebaseAuthConfig),
        ],
        providers: [
            HomeComponent,
        ],
    }));

    it('should have default data', inject([HomeComponent], (home: HomeComponent) => {
github YourName-App / MyDiary / src / app / app.module.ts View on Github external
import { ChineseDay } from '../pipes/chinese-day';

// Import AF2 Module
import { AngularFireModule, AuthProviders, AuthMethods } from 'angularfire2';

// AF2 Settings (test env)
export const firebaseConfig = {
  apiKey: "AIzaSyDjNlZc4roJUyMZR_5wRoflvWr6kcUnzEw",
  authDomain: "mydiary-1b17a.firebaseapp.com",
  databaseURL: "https://mydiary-1b17a.firebaseio.com",
  storageBucket: "mydiary-1b17a.appspot.com",
  messagingSenderId: "647185474664"
};

const myFirebaseAuthConfig = {
  provider: AuthProviders.Password,
  method: AuthMethods.Password
}

// Import internationlization module
import { Http } from '@angular/http';
import {TranslateModule, TranslateStaticLoader, TranslateLoader } from 'ng2-translate/ng2-translate';

// Internationalization factory
export function createTranslateLoader(http: Http) {
  return new TranslateStaticLoader(http, 'assets/i18n', '.json');
}

@NgModule({
  declarations: [
    MyApp,
    TabsPage,
github joaogarin / angularfire2-firebase3-electron / src / app / app.ts View on Github external
/**
 * Basic configuration like Endpoint URL's, API version..
 */
const options = require('./config.json');

// Initialize Firebase
export const firebaseConfig = {
    apiKey: options.firebase.apiKey,
    authDomain: options.firebase.authDomain,
    databaseURL: options.firebase.databaseURL,
    storageBucket: options.firebase.storageBucket,
};

const firebaseAuthConfig = {
    provider: AuthProviders.Password,
    method: AuthMethods.Password,
};

@NgModule({
    imports: [
        BrowserModule,
        FormsModule,
        ReactiveFormsModule,
        RouterModule.forRoot(routes, { useHash: true }),
        AngularFireModule.initializeApp(firebaseConfig, firebaseAuthConfig),
    ],
    declarations: [AppComponent, HomeComponent, LoginComponent, RegisterComponent],
    bootstrap: [AppComponent]
})
export class AppModule { }
platformBrowserDynamic().bootstrapModule(AppModule);
github aaronksaunders / ionic2.0-angularfire / src / app / store / mainEffects.ts View on Github external
return Observable.create((observer) => {
            this.auth$.login(_creds, {
                provider: AuthProviders.Password,
                method: AuthMethods.Password
            }).then((_result) => {
                console.log("_result", _result)
                return observer.next({ type: LOGIN_SUCCESS, payload: _result })
            }, (error) => {
                console.log("error", error)
                return observer.next({ type: LOGIN_FAILED, payload: error })
            })
        })
    }
github Lacka90 / ionic-photo-maps / src / app / app.module.ts View on Github external
import { PhotoStorage } from '../services/storage';
import { AuthService } from '../services/auth';
import { AngularFireModule, AuthProviders, AuthMethods } from 'angularfire2';

import * as config from '../config.json';

const firebaseConfig = {
  apiKey: config.apiKey,
  authDomain: config.authDomain,
  databaseURL: config.databaseUrl,
  storageBucket: config.storageBucket,
  messagingSenderId: config.messagingSenderId,
};

const firebaseAuthConfig = {
  provider: AuthProviders.Password,
  method: AuthMethods.Password
};

@NgModule({
  declarations: [
    MyApp,
    HomePage,
    PhotoPage,
    MapsPage
  ],
  imports: [
    IonicModule.forRoot(MyApp),
    AngularFireModule.initializeApp(firebaseConfig, firebaseAuthConfig)
  ],
  bootstrap: [IonicApp],
  entryComponents: [
github rodrigoreal / ionic3-angularfire-login / src / providers / auth.ts View on Github external
return Observable.create(observer => {
      this.af.auth.login(credentials, {
        provider: AuthProviders.Password,
        method: AuthMethods.Password
      }).then((authData) => {
        observer.next(authData);
      }).catch((error) => {
        observer.error(error);
      });
    });
  }
github rodrigoreal / ionic3-angularfire-login / app / providers / auth / auth.ts View on Github external
return Observable.create(observer => {
      this.af.auth.login(credentials, {
        provider: AuthProviders.Password,
        method: AuthMethods.Password
      }).then((authData) => {
        observer.next(authData);
      }).catch((error) => {
        observer.error(error);
      });
    });
  }
github dianedouglas / skill_share / src / environments / firebase.config.ts View on Github external
import {AuthMethods, AuthProviders} from "angularfire2";

export const firebaseConfig = {
    apiKey: "AIzaSyDhyRz5WogFqRN9wBYLLIVhFUIOuNeebts",
    authDomain: "skill-share-angular2-19e00.firebaseapp.com",
    databaseURL: "https://skill-share-angular2-19e00.firebaseio.com",
    storageBucket: "skill-share-angular2-19e00.appspot.com",
    messagingSenderId: "729612898539"
};



export const authConfig = {
    provider: AuthProviders.Password,
    method: AuthMethods.Password
};
github angular-university / courses / 01-getting-started-with-angular2 / final-project / src / environments / firebase.config.ts View on Github external
import {AuthProviders, AuthMethods} from "angularfire2";


export const firebaseConfig = {
  apiKey: "AIzaSyBhuIkN2d6xNe7DwxzjCRhBIWiu1-mJ9vo",
  authDomain: "final-project-ac645.firebaseapp.com",
  databaseURL: "https://final-project-ac645.firebaseio.com",
  storageBucket: "final-project-ac645.appspot.com",
};


export const authConfig = {
  provider: AuthProviders.Password,
  method: AuthMethods.Password
};
github luisjmrtnz / ionic-social-network / src / providers / auth.service.ts View on Github external
signin(credentails) {   
    return this.af.auth.login(
      credentails, 
      {
       provider: AuthProviders.Password,
       method: AuthMethods.Password
      });
  }