Demo Firebase phone authentication reactjs with recaptcha

แชร์
ฝัง

ความคิดเห็น • 13

  • @baobaostore
    @baobaostore  3 ปีที่แล้ว

    import React, { Component } from 'react';
    import firebaseConfig from './firebaseConfig';
    import * as firebaseui from 'firebaseui';
    import firebase from 'firebase';
    import 'firebaseui/dist/firebaseui.css';
    class App extends Component {
    componentDidMount() {
    firebase.initializeApp(firebaseConfig);
    const uiConfig = {
    signInOptions: [{
    provider: firebase.auth.PhoneAuthProvider.PROVIDER_ID,
    recaptchaParameters: {
    type: 'image',
    size: 'normal',
    badge: 'bottomleft'
    },
    defaultCountry: 'VN'
    }],
    callbacks: {
    signInSuccessWithAuthResult: function(authResult, redirectUrl){
    alert('successful');
    return true;
    }
    },
    signInSuccessUrl : "youtube.com"
    };
    var ui = new firebaseui.auth.AuthUI(firebase.auth());
    ui.start("#firebaseui-auth-container", uiConfig);
    };
    render() {
    return (

    );
    }
    }
    export default App;

  • @bismanazir8126
    @bismanazir8126 3 ปีที่แล้ว +1

    one of the accurate video on TH-cam , you just saved me I am trying to do this from two days. Finally got it done just because of you. Thank you soo much

  • @ucPham-xc9kj
    @ucPham-xc9kj ปีที่แล้ว

    anh ơi em bị lỗi Firebase: Firebase App named '[DEFAULT]' already exists (app/duplicate-app).
    FirebaseError: Firebase: Firebase App named '[DEFAULT]' already exists (app/duplicate-app). ạ...Làm sao để khắc phục được ạ...?

  • @SUNYBOI
    @SUNYBOI 3 ปีที่แล้ว +2

    Add email password authentication also to it

  • @INVADE.00
    @INVADE.00 7 หลายเดือนก่อน

    Firebase: Error (auth/configuration-not-found). Dismiss facing this error

  • @pepsi1910
    @pepsi1910 2 ปีที่แล้ว +1

    em đổi tên file index.html thành SDT.html thì nó không hiện gì hết là sao anh

    • @baobaostore
      @baobaostore  2 ปีที่แล้ว +1

      Trong thư mục public bắt buộc phải có file *index.html* nha bạn (không được đổi tên file này). Phần code react bạn nên tạo file .js để bên ngoài thư mục public

    • @pepsi1910
      @pepsi1910 2 ปีที่แล้ว

      @@baobaostore file index.html của em để làm trang chủ á anh còn file để xác thực SĐT thì em đổi thành SDT.html thì lúc mà em vào để xác thực SĐT thì nó không hiện cái gì hết á anh

    • @baobaostore
      @baobaostore  2 ปีที่แล้ว +1

      Bạn liên kết 2 file đó lại như thế nào? mở F12 *console.log* có hiện gì không? Bạn up code lên mình xem thử nha!

    • @pepsi1910
      @pepsi1910 2 ปีที่แล้ว

      đây là file index.html nè anh



      Document
      bấm vào đây để liên kết SĐT

    • @baobaostore
      @baobaostore  2 ปีที่แล้ว +1

      @@pepsi1910 phần code bên file *SDT.html* bạn có import firebase SDK vào chưa? (cái này có code mẫu khi mới tạo project firebase trên web) bạn phải cho nó init khi window.onload

  • @gnani344
    @gnani344 2 ปีที่แล้ว

    Firebase: Hostname match not found (auth/captcha-check-failed).