-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Description
This issue is very similar to issue #107, here is my user service:
import { Injectable } from '@angular/core';
import { AngularFire, FirebaseAuth } from 'angularfire2';
@Injectable()
export class UserService {
public db: any;
constructor(private af: AngularFire, private auth: FirebaseAuth) { }
signUp(email: string, password: string) {
var creds: any = {email: email, password: password};
this.af.auth.createUser(creds);
}
login(email: string, password: string) {
var creds: any = {email: email, password: password};
this.af.auth.login(creds).then(result => { });
}
}
createUser()
works fine, login()
throws the error Error: Uncaught (in promise): You must include credentials to use this auth method.
My configuration:
import { bootstrap } from '@angular/platform-browser-dynamic';
import { MyApp } from './app/';
import {
FIREBASE_PROVIDERS,
defaultFirebase,
AngularFire,
AuthMethods,
AuthProviders,
firebaseAuthConfig } from 'angularfire2';
import { UserService } from './app/user.service'
bootstrap(MyApp, [
FIREBASE_PROVIDERS,
defaultFirebase({
...
}),
firebaseAuthConfig({
provider: AuthProviders.Password,
method: AuthMethods.Password
}),
UserService
]);
sorcamarian
Metadata
Metadata
Assignees
Labels
No labels