当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript app.auth函数代码示例

本文整理汇总了TypeScript中firebase/app.auth函数的典型用法代码示例。如果您正苦于以下问题:TypeScript auth函数的具体用法?TypeScript auth怎么用?TypeScript auth使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了auth函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: Promise

 return new Promise((resolve, reject) => {
   firebase.auth().sendPasswordResetEmail(email).then((data) => {
     resolve(data);
   }, (error) => {
     reject(error);
   });
 });
开发者ID:mbibekjana,项目名称:nafisa_capital,代码行数:7,代码来源:auth.ts

示例2: constructor

    constructor(model: BagitModelService)
    {
        this._curFirebaseUser = undefined;
        this._currentUser$    = new BehaviorSubject<User | null>(null);
        this._model = model;

        //
        // Setup to handle authentication state changes.
        //
        this._authInitializedPromise = new Promise((resolve) => {
            // Hang on to the resolve function so that we can call it once the
            // initial auth state change happens.
            this._resolveAuthInitializedPromise = resolve;

        });
        this._firebaseAuth = auth();
        this._firebaseAuth.onAuthStateChanged(this.onAuthStateChanged.bind(this));

        this._isConnected$ = new BehaviorSubject<boolean>(false);
        const connectedRef = database().ref(".info/connected");
        connectedRef.on("value", (snap: database.DataSnapshot | null) => {
            if (snap) {
                this._isConnected$.next(snap.val());
            }
        });
    }
开发者ID:kwpeters,项目名称:bagit,代码行数:26,代码来源:model-user.service.ts

示例3: resolve

 }).then((response) => {
   const googleCredential = firebase.auth.GoogleAuthProvider.credential(response.idToken);
   firebase.auth().signInWithCredential(googleCredential)
   .then((user) => {
     resolve();
   });
 },(err) => {
开发者ID:mksalin,项目名称:test_repository,代码行数:7,代码来源:auth.service.ts

示例4: registerAccount

 async registerAccount(username: string, password: string) {
     await firebase.auth().createUserWithEmailAndPassword(username, password);
     setImmediate(async () => {
         await MessageBox.show(`Thank you for signing up ${username}. Please login now.`, "Welcome", MessageBoxButtons.OK, MessageBoxIcon.Information);
         let dialog = new LoginDialog(this.login.bind(this), this.resetPassword.bind(this), this.signup.bind(this));
         dialog.open();
     });
 }
开发者ID:mlaanderson,项目名称:firebase-budget,代码行数:8,代码来源:viewer.ts

示例5: Promise

 return new Promise((resolve, reject) => {
   if(firebase.auth().currentUser){
     this.afAuth.auth.signOut();
     resolve();
   }
   else{
     reject();
   }
 });
开发者ID:castcosme,项目名称:LabWeb2019PracticasFinal,代码行数:9,代码来源:auth.service.ts

示例6: resolve

 return new Promise<any>((resolve, reject) => {
   var user = firebase.auth().currentUser;
   user.updateProfile({
     displayName: value.name,
     photoURL: user.photoURL
   }).then(res => {
     resolve(res);
   }, err => reject(err))
 })
开发者ID:castcosme,项目名称:LabWeb2019PracticasFinal,代码行数:9,代码来源:user.service.ts

示例7: sendResetEmail

 async sendResetEmail(username: string) { 
     firebase.auth().sendPasswordResetEmail(username, {
         url: `${location.origin}?email=${encodeURIComponent(username)}`
     });
     Spinner.hide();
     await MessageBox.show("The password reset has been sent. Check your inbox for instructions.", "Reset Email Sent", MessageBoxButtons.OK, MessageBoxIcon.Information);
     let loginDialog = new LoginDialog(this.login.bind(this), this.resetPassword.bind(this), this.signup.bind(this));
     loginDialog.open();
 }
开发者ID:mlaanderson,项目名称:firebase-budget,代码行数:9,代码来源:viewer.ts


注:本文中的firebase/app.auth函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。