How to change a prompt to an input text and wait the user until send the code in firebase verifyPhoneNumber method?Firebase WEB - Email Verification not being sent. What's wrong with the codeAndroid Firebase: does SMS code have to be sent everytime user signs in?Firebase email verification WITHOUT creating and accountfirebase auth Invalide codepin sended known that i set the right codeFirebase: How to do a phone number authentication after the user has been registered?RN / Firebase: Link a phone credential with an existing accountFirebase PhoneAuthentication not returning verification CodeHow to send a verification code to an email idhow to handle when user selects wrong images for the invisible recaptcha challenge that comes with firebase?Firebase Phone Auth Verification is very slow

Wiring IKEA light fixture into old fixture

How to work a regular job as a former celebrity

Can we have too many dialogue tags and follow up actions?

How can I deal with someone that wants to kill something that isn't supposed to be killed?

Chemistry Riddle

What is a "staved" town, like in "Staverton"?

If hash functions append the length, why does length extension attack work?

Can a creature sustain itself by eating its own severed body parts?

How can I calculate the cost of Skyss bus tickets

High income and difficulty during interviews

Is it ethical to tell my teaching assistant that I like him?

Import data from a current web session?

Do you have to hide in order for other creatures to not know your location inside a fog cloud?

Are rockets faster than airplanes?

Is an easily guessed plot twist a good plot twist?

Inverse Colombian Function

Higher calorie ice cream

What kind of anatomy does a centaur have?

Ultraproduct of Dividing Lines

Can't understand how static works exactly

How could Barty Crouch Jr. have run out of Polyjuice Potion at the end of the Goblet of Fire movie?

Character Arcs - What if the character doesn't overcome the big lie, flaws or wounds?

Found more old paper shares from broken up companies

how to add 1 milliseconds on a datetime string?



How to change a prompt to an input text and wait the user until send the code in firebase verifyPhoneNumber method?


Firebase WEB - Email Verification not being sent. What's wrong with the codeAndroid Firebase: does SMS code have to be sent everytime user signs in?Firebase email verification WITHOUT creating and accountfirebase auth Invalide codepin sended known that i set the right codeFirebase: How to do a phone number authentication after the user has been registered?RN / Firebase: Link a phone credential with an existing accountFirebase PhoneAuthentication not returning verification CodeHow to send a verification code to an email idhow to handle when user selects wrong images for the invisible recaptcha challenge that comes with firebase?Firebase Phone Auth Verification is very slow






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I am working on an angular project where user can Verify order by enter his phone number and get a Verification Code in his phone and then send it back with Firebase verifyPhoneNumber Method.
I want to change the code from getting the Verification Code of a prompt to an input shown after the user enter his number and click send the code button.



ngOnInit()
...
firebase.auth().useDeviceLanguage();
this.windowRef = this.win.windowRef;
this.windowRef.recaptchaVerifier = new firebase.auth.RecaptchaVerifier('recaptcha-container');
this.windowRef.recaptchaVerifier.render();
this.provider = new firebase.auth.PhoneAuthProvider();


sendLoginCode()
const appVerifier = this.windowRef.recaptchaVerifier;
const num = this.phoneNumber.e164;
console.log(num);

this.provider.verifyPhoneNumber(num, appVerifier)
.then(verificationId =>
var verificationCode = window.prompt('Please enter the verification code that was sent to your mobile device.');
return firebase.auth.PhoneAuthProvider.credential(verificationId,
verificationCode);
)
.then(phoneCredential =>
console.log(phoneCredential);
return firebase.auth().currentUser.updatePhoneNumber(phoneCredential);
)
.catch(err => console.log(err) );



I think this function need to be splited and It need to add a function to verify the verification code and execute the rest of the function.










share|improve this question






























    1















    I am working on an angular project where user can Verify order by enter his phone number and get a Verification Code in his phone and then send it back with Firebase verifyPhoneNumber Method.
    I want to change the code from getting the Verification Code of a prompt to an input shown after the user enter his number and click send the code button.



    ngOnInit()
    ...
    firebase.auth().useDeviceLanguage();
    this.windowRef = this.win.windowRef;
    this.windowRef.recaptchaVerifier = new firebase.auth.RecaptchaVerifier('recaptcha-container');
    this.windowRef.recaptchaVerifier.render();
    this.provider = new firebase.auth.PhoneAuthProvider();


    sendLoginCode()
    const appVerifier = this.windowRef.recaptchaVerifier;
    const num = this.phoneNumber.e164;
    console.log(num);

    this.provider.verifyPhoneNumber(num, appVerifier)
    .then(verificationId =>
    var verificationCode = window.prompt('Please enter the verification code that was sent to your mobile device.');
    return firebase.auth.PhoneAuthProvider.credential(verificationId,
    verificationCode);
    )
    .then(phoneCredential =>
    console.log(phoneCredential);
    return firebase.auth().currentUser.updatePhoneNumber(phoneCredential);
    )
    .catch(err => console.log(err) );



    I think this function need to be splited and It need to add a function to verify the verification code and execute the rest of the function.










    share|improve this question


























      1












      1








      1








      I am working on an angular project where user can Verify order by enter his phone number and get a Verification Code in his phone and then send it back with Firebase verifyPhoneNumber Method.
      I want to change the code from getting the Verification Code of a prompt to an input shown after the user enter his number and click send the code button.



      ngOnInit()
      ...
      firebase.auth().useDeviceLanguage();
      this.windowRef = this.win.windowRef;
      this.windowRef.recaptchaVerifier = new firebase.auth.RecaptchaVerifier('recaptcha-container');
      this.windowRef.recaptchaVerifier.render();
      this.provider = new firebase.auth.PhoneAuthProvider();


      sendLoginCode()
      const appVerifier = this.windowRef.recaptchaVerifier;
      const num = this.phoneNumber.e164;
      console.log(num);

      this.provider.verifyPhoneNumber(num, appVerifier)
      .then(verificationId =>
      var verificationCode = window.prompt('Please enter the verification code that was sent to your mobile device.');
      return firebase.auth.PhoneAuthProvider.credential(verificationId,
      verificationCode);
      )
      .then(phoneCredential =>
      console.log(phoneCredential);
      return firebase.auth().currentUser.updatePhoneNumber(phoneCredential);
      )
      .catch(err => console.log(err) );



      I think this function need to be splited and It need to add a function to verify the verification code and execute the rest of the function.










      share|improve this question
















      I am working on an angular project where user can Verify order by enter his phone number and get a Verification Code in his phone and then send it back with Firebase verifyPhoneNumber Method.
      I want to change the code from getting the Verification Code of a prompt to an input shown after the user enter his number and click send the code button.



      ngOnInit()
      ...
      firebase.auth().useDeviceLanguage();
      this.windowRef = this.win.windowRef;
      this.windowRef.recaptchaVerifier = new firebase.auth.RecaptchaVerifier('recaptcha-container');
      this.windowRef.recaptchaVerifier.render();
      this.provider = new firebase.auth.PhoneAuthProvider();


      sendLoginCode()
      const appVerifier = this.windowRef.recaptchaVerifier;
      const num = this.phoneNumber.e164;
      console.log(num);

      this.provider.verifyPhoneNumber(num, appVerifier)
      .then(verificationId =>
      var verificationCode = window.prompt('Please enter the verification code that was sent to your mobile device.');
      return firebase.auth.PhoneAuthProvider.credential(verificationId,
      verificationCode);
      )
      .then(phoneCredential =>
      console.log(phoneCredential);
      return firebase.auth().currentUser.updatePhoneNumber(phoneCredential);
      )
      .catch(err => console.log(err) );



      I think this function need to be splited and It need to add a function to verify the verification code and execute the rest of the function.







      javascript firebase firebase-authentication






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 26 at 14:56









      Frank van Puffelen

      265k33 gold badges427 silver badges452 bronze badges




      265k33 gold badges427 silver badges452 bronze badges










      asked Mar 26 at 13:54









      Mohamed AyadiMohamed Ayadi

      62 bronze badges




      62 bronze badges






















          0






          active

          oldest

          votes










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55358888%2fhow-to-change-a-prompt-to-an-input-text-and-wait-the-user-until-send-the-code-in%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes




          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55358888%2fhow-to-change-a-prompt-to-an-input-text-and-wait-the-user-until-send-the-code-in%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Obelisk of Theodosius Contents History Description Notes Bibliography Further reading External links Navigation menuAge of spirituality : late antique and early Christian art, third to seventh centuryOver 60 picturesObelisks of the World41°00′21.24″N 28°58′31.43″E / 41.0059000°N 28.9753972°E / 41.0059000; 28.97539727724550-7235741376235741376

          밀양 대씨 역사 각주 함께 보기 둘러보기 메뉴밀양 대씨

          1973년 목차 사건 문화 탄생 사망 노벨상 달력 둘러보기 메뉴