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


TypeScript firebase.auth函數代碼示例

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


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

示例1:

 response => {
   this.router.navigate(['/']);
   firebase.auth().currentUser.getIdToken()
     .then(
       (token: string) => {
         this.token = token;
       }
     );
 }
開發者ID:rosskovt,項目名稱:recipe-app,代碼行數:9,代碼來源:auth.service.ts

示例2: signupUser

  signupUser(email: string, password: string): Promise<any> {
    return firebase.auth().createUserWithEmailAndPassword(email, password)
      .then(newUser => {
        firebase.database().ref('/userProfile').child(newUser.uid)
        .set({ email: email });

 
      });
  }
開發者ID:araujomelogno,項目名稱:EquiposPregunta,代碼行數:9,代碼來源:auth.ts

示例3: getToken

 getToken() {
   firebase.auth().currentUser.getIdToken()
     .then(
       (token: string) => {
         this.token = token;
       }
     );
   return this.token;
 }
開發者ID:rosskovt,項目名稱:recipe-app,代碼行數:9,代碼來源:auth.service.ts

示例4:

 response => {
     this.router.navigate(['/']);
     // firebase.auth().currentUser.getToken()
     firebase.auth().currentUser.getIdToken()
     .then(
         (token: string) => this.token = token
     );
 this.alertService.showToaster('Login succesful');
 }
開發者ID:Hulva,項目名稱:Angular4MaterialDesign,代碼行數:9,代碼來源:auth.service.ts

示例5: createProduct

    createProduct(event) {
        event.preventDefault();
        let self = this;
        self.loading = Loading.create({
            // message: "processing..."
        });
        this.nav.present(self.loading);
        var userId = firebase.auth().currentUser.uid;
        firebase.database().ref('/userProfile/' + userId).once('value').then(function(snapshot) {
            var timestamp = (new Date()).getTime();
        	var product = {
                seller_id: userId,
                seller_name: snapshot.val().name,
                seller_image: snapshot.val().image,
                seller_email: snapshot.val().email,
                name: self.productForm.value.name,
                tagline: self.productForm.value.tagline,
                price: self.productForm.value.price,
                description: self.productForm.value.description,
                image: self.imgURI,
                created_at: timestamp,
                updated_at: timestamp
            };
            self.Products.createProduct(product).then((data) => {
                    console.log("success:", data);
                    
                    self.loading.dismiss().then(function(){
                        self.toast = Toast.create({
                            message: "Create product success!",
                            duration: 1000,
                            position: 'bottom'
                        });
                        self.nav.present(self.toast);
                    });



                    // self.nav.Tab.setSelected(1);
                }, (error) => {
                    console.log("failed:", error);
                    
                    self.loading.dismiss().then(function(){
                        self.toast = Toast.create({
                            message: "Create product failed!",
                            duration: 1000,
                            position: 'bottom'
                        });
                        self.nav.present(self.toast);
                    });
                })    
        
        });
        
        // var current_user = this.authData.getCurrentUser();
        // console.log("current_user:", current_user);
    }
開發者ID:khavq,項目名稱:ion2-bangbang,代碼行數:56,代碼來源:photo-detail.ts

示例6: facebookLogin

  facebookLogin(): any {
    firebase.auth().signInWithPopup(this.facebookAuth).then(function (result) {
      console.log(result);
      console.log("Facebook Login");

    }).catch(function (error) {
      console.log("Facebook Login Error");
      console.log(error);
    });
  }
開發者ID:zeeshanshanif,項目名稱:Firebase-fb-auth,代碼行數:10,代碼來源:auth-data.ts

示例7: isAuthenticated

 isAuthenticated()
 {
    const user = firebase.auth().currentUser;
    
    if(user)
     {
       return true;
     }
     return false;
 }
開發者ID:Corovino,項目名稱:appCompras,代碼行數:10,代碼來源:autenticacion.service.ts

示例8: inicioSesion

 inicioSesion(userdata)
 {
   firebase.auth().signInWithEmailAndPassword(userdata.email,userdata.password)
       .then( resp => {
         console.log(resp);
         this.router.navigate(['/inicio']);
       }).catch( error => {
          console.log(error);
       })
 }
開發者ID:Corovino,項目名稱:appCompras,代碼行數:10,代碼來源:autenticacion.service.ts

示例9:

 response => {
   this.store.dispatch(new AuthActions.Signin());
   this.router.navigate(['/']);
   firebase.auth().currentUser.getToken()
     .then(
       (token: string) => {
         this.store.dispatch(new AuthActions.SetToken(token));
       }
     )
 }
開發者ID:vsushko,項目名稱:research,代碼行數:10,代碼來源:auth.service.ts


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