|
@@ -2,6 +2,7 @@ import React from 'react'
|
2
|
2
|
import { connect } from 'react-redux'
|
3
|
3
|
import { Redirect } from 'react-router'
|
4
|
4
|
import { translate } from 'react-i18next'
|
|
5
|
+import Cookies from 'js-cookie'
|
5
|
6
|
import LoginLogo from '../component/Login/LoginLogo.jsx'
|
6
|
7
|
import LoginLogoImg from '../img/logoTracimWhite.svg'
|
7
|
8
|
import { postUserLogin } from '../action-creator.async.js'
|
|
@@ -9,15 +10,13 @@ import Card from '../component/common/Card/Card.jsx'
|
9
|
10
|
import CardHeader from '../component/common/Card/CardHeader.jsx'
|
10
|
11
|
import CardBody from '../component/common/Card/CardBody.jsx'
|
11
|
12
|
import InputGroupText from '../component/common/Input/InputGroupText.jsx'
|
12
|
|
-// import InputCheckbox from '../component/common/Input/InputCheckbox.jsx'
|
13
|
13
|
import Button from '../component/common/Input/Button.jsx'
|
14
|
14
|
import LoginBtnForgotPw from '../component/Login/LoginBtnForgotPw.jsx'
|
15
|
15
|
import {
|
16
|
16
|
newFlashMessage,
|
17
|
17
|
setUserConnected
|
18
|
18
|
} from '../action-creator.sync.js'
|
19
|
|
-import { PAGE } from '../helper.js'
|
20
|
|
-import Cookies from 'js-cookie'
|
|
19
|
+import { COOKIE, PAGE } from '../helper.js'
|
21
|
20
|
|
22
|
21
|
class Login extends React.Component {
|
23
|
22
|
constructor (props) {
|
|
@@ -53,8 +52,8 @@ class Login extends React.Component {
|
53
|
52
|
logged: true
|
54
|
53
|
}))
|
55
|
54
|
|
56
|
|
- Cookies.set('user_login', inputLogin.value)
|
57
|
|
- Cookies.set('user_auth', userAuth)
|
|
55
|
+ Cookies.set(COOKIE.USER_LOGIN, inputLogin.value)
|
|
56
|
+ Cookies.set(COOKIE.USER_AUTH, userAuth)
|
58
|
57
|
|
59
|
58
|
history.push(PAGE.HOME)
|
60
|
59
|
} else if (fetchPostUserLogin.status === 400) {
|