当前位置: 首页>>代码示例>>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;未经允许,请勿转载。