當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript angularfire2.AngularFireAuth類代碼示例

本文整理匯總了TypeScript中angularfire2.AngularFireAuth的典型用法代碼示例。如果您正苦於以下問題:TypeScript AngularFireAuth類的具體用法?TypeScript AngularFireAuth怎麽用?TypeScript AngularFireAuth使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了AngularFireAuth類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: loginWithEmail

 loginWithEmail(email, password) {
   return this.auth.login({
       email: email,
       password: password,
     },
     {
       provider: AuthProviders.Password,
       method: AuthMethods.Password,
     });
 }
開發者ID:rvanmarkus,項目名稱:alueco,代碼行數:10,代碼來源:auth-service.ts

示例2: angularFireAuth

 private angularFireAuth(accessToken) {
   let creds = firebase.auth.FacebookAuthProvider.credential(accessToken);
   this.auth.login(creds, {provider: AuthProviders.Facebook, method: AuthMethods.OAuthToken})
     .then((auth: FirebaseAuthState) => {
       this.toastService.show('TOAST_SIGNED_IN');
       const data = auth.auth;
       const facebookUid = data['providerData'][0].uid;
       this.af.database.object(`/users/${auth.uid}`).update({
         image: `http://graph.facebook.com/${facebookUid}/picture?type=large`,
         email: data.email,
         name: data.displayName
       });
     })
     .catch((error) => {
       alert("Firebase failure: " + JSON.stringify(error));
     });
 }
開發者ID:ActiverLtd,項目名稱:Mobile,代碼行數:17,代碼來源:facebook-login.component.ts

示例3: constructor

 constructor(private af: AngularFire) {
   this.auth = af.auth;
   this.user = this.auth
     .filter(auth => auth !== null)
     .map(auth => AluecoUser.fromAuthSession(auth));
 }
開發者ID:rvanmarkus,項目名稱:alueco,代碼行數:6,代碼來源:auth-service.ts

示例4: loginWithGoogle

 loginWithGoogle(): firebase.Promise<FirebaseAuthState> {
   return this.auth.login({
     provider: AuthProviders.Google,
     method: AuthMethods.Popup,
   });
 }
開發者ID:rvanmarkus,項目名稱:alueco,代碼行數:6,代碼來源:auth-service.ts

示例5: createAuthUser

 createAuthUser(user: { email: string, password: string }): firebase.Promise<FirebaseAuthState> {
   return this.auth.createUser(user)
     .catch(this.handlePromiseError);;
 }
開發者ID:wpbarcelos,項目名稱:ionicfirebasechat,代碼行數:4,代碼來源:auth.ts


注:本文中的angularfire2.AngularFireAuth類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。