當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。