Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 662 | Rev 3670 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 662 Rev 2719
Línea 1... Línea 1...
1
import React from "react";
1
import React from "react";
2
import { useRef, useState, useEffect } from "react";
2
import { useRef, useState, useEffect } from "react";
3
import { useForm } from "react-hook-form";
3
import { useForm } from "react-hook-form";
4
import styled from "styled-components";
4
import styled from "styled-components";
5
import {axios} from "../../../../utils";
5
import { axios } from "../../../../utils";
6
import FormErrorFeedback from "../../../../shared/form-error-feedback/FormErrorFeedback";
6
import FormErrorFeedback from "../../../../shared/form-error-feedback/FormErrorFeedback";
7
import Recaptcha from "react-recaptcha";
7
import Recaptcha from "react-recaptcha";
8
import Spinner from "../../../../shared/loading-spinner/Spinner";
8
import Spinner from "../../../../shared/loading-spinner/Spinner";
9
import cryptoJsAesJson from "../../../../utils/crypto-js/cryptojs-aes-format";
9
import cryptoJsAesJson from "../../../../utils/crypto-js/cryptojs-aes-format";
Línea 116... Línea 116...
116
  };
116
  };
Línea 117... Línea 117...
117
 
117
 
118
  const getRedirectUrl = async (endpoint) => {
118
  const getRedirectUrl = async (endpoint) => {
119
    try {
119
    try {
120
      const res = await axios.get(endpoint)
120
      const res = await axios.get(endpoint)
121
      if(res.data && res.data.data){
121
      if (res.data && res.data.data) {
122
        window.location.href = res.data.data
122
        window.location.href = res.data.data
123
      }
123
      }
124
    } catch (error) {
124
    } catch (error) {
125
       ('>>: error > ', error)
125
      ('>>: error > ', error)
126
    }
126
    }
127
  }
127
  }
128
  return (
128
  return (
129
    <React.Fragment>
129
    <React.Fragment>
Línea 139... Línea 139...
139
                  ref={register({
139
                  ref={register({
140
                    required: "Este campo es requerido",
140
                    required: "Este campo es requerido",
141
                  })}
141
                  })}
142
                  placeholder="Correo electrónico"
142
                  placeholder="Correo electrónico"
143
                  maxLength="64"
143
                  maxLength="64"
144
                  // onChange={() => clearErrors("email")}
144
                // onChange={() => clearErrors("email")}
145
                />
145
                />
146
                <i className="la la-envelope"></i>
146
                <i className="la la-envelope"></i>
147
              </div>
147
              </div>
148
              {errors.email && (
148
              {errors.email && (
149
                <FormErrorFeedback>{errors.email.message}</FormErrorFeedback>
149
                <FormErrorFeedback>{errors.email.message}</FormErrorFeedback>
Línea 197... Línea 197...
197
              </div>
197
              </div>
198
            </div>
198
            </div>
199
          </div>
199
          </div>
Línea 200... Línea 200...
200
 
200
 
201
          <div className="col-lg-12 no-pdd">
201
          <div className="col-lg-12 no-pdd">
202
            <div className="sn-field border">
202
            <div className="sn-field">
203
              <Recaptcha
203
              <Recaptcha
204
                sitekey={captchaKey}
204
                sitekey={captchaKey}
205
                verifyCallback={loginVerifyCallbackHandler}
205
                verifyCallback={loginVerifyCallbackHandler}
206
                verifyCallbackName="loginVerifyCallbackHandler"
206
                verifyCallbackName="loginVerifyCallbackHandler"
Línea 231... Línea 231...
231
          <div className="login-resources">
231
          <div className="login-resources">
232
            <h4>Entrar usando su red social</h4>
232
            <h4>Entrar usando su red social</h4>
233
            <ul>
233
            <ul>
234
              <li>
234
              <li>
235
                <a onClick={() => getRedirectUrl(facebookOauth)}
235
                <a onClick={() => getRedirectUrl(facebookOauth)}
236
                title=""
236
                  title=""
237
                className="cursor-pointer fb text-white">
237
                  className="cursor-pointer fb text-white">
238
                  <i className="fa fa-facebook"></i> FACEBOOK
238
                  <i className="fa fa-facebook"></i> FACEBOOK
239
                </a>
239
                </a>
240
              </li>
240
              </li>
241
              <li>
241
              <li>
242
                <a
242
                <a