Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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) => {
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,
/**
* 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);
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 })
})
})
}
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: [
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);
});
});
}
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);
});
});
}
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
};
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
};
signin(credentails) {
return this.af.auth.login(
credentails,
{
provider: AuthProviders.Password,
method: AuthMethods.Password
});
}