Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

518
Vistas
How to create an account with Firebase and send a verification email to that email?

I'm making a signup function with react and firebase right now, and when I sign up, I want to send an authentication code to the e-mail that the user writes. I'm a beginner, so the code may be weird, but is there a way to send the verification code from this code?`

import React, { useRef, useState } from 'react';
import { Card, Button, Form, Alert } from "react-bootstrap"
import { useAuth } from '../contexts/AuthContext';

export default function Signup() {

    const emailRef = useRef()
    const passwordRef = useRef()
    const passwordComfirmRef = useRef()
    const { signup, currentUser } = useAuth()
    const [error, setError] = useState("")
    const [loading, setLoading] = useState(false)

    async function handleSubmit(e){
        e.preventDefault()

        if(passwordRef.current.value !== 
            passwordComfirmRef.current.value){
            return setError('Passwords do not match')
        }

       try{
        setError("")
           setLoading(true)
           await signup(emailRef.current.value, passwordRef.current.value)
       } catch{
        setError('we cant create account')
       }

         setLoading(false)
    }

  return <>
      <Card>
          <Card.Body>
              <h2 className="text-center mb-4">register</h2>
              {currentUser && currentUser.email}
              {error && <Alert className='alert alert-danger'>{error}</Alert>}
            <Form onSubmit={handleSubmit}>
              <Form.Group  className='mb-2'  id="email">
                <Form.Label>email</Form.Label>
                <Form.Control type="email" ref={emailRef}   />
              </Form.Group>
              <Form.Group className='mb-2'  id="password">
                <Form.Label>password</Form.Label>
                <Form.Control type="password" ref={passwordRef}  />
              </Form.Group>
              <Form.Group  className='mb-4' id="email">
                <Form.Label>password comfirm</Form.Label>
                <Form.Control type="password" ref={passwordComfirmRef}  />
              </Form.Group>
              <Button disabled={loading} className='w-100' type='submit'>
                  register
                </Button>
                <div className='w-100 text-center mt-3'>
                    do you have account? <a className='text-primary'>lgoin</a> 
                </div>
              </Form>
          </Card.Body>
      </Card>
     

  </>;
}
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda