summaryrefslogtreecommitdiff
path: root/src/containers/auth/Login.js
diff options
context:
space:
mode:
authorGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-08-15 23:24:28 +0300
committerGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-09-23 10:05:42 +0200
commit91c8088e1d7def9242f60c708cd34f25dcb77d76 (patch)
treeb68065019692cea5cf6c3d14b811104aff2f0879 /src/containers/auth/Login.js
parentd7512ace72448242b392299cf459c9c72c8dbee5 (diff)
Connect to backend and fetch initial project data
Diffstat (limited to 'src/containers/auth/Login.js')
-rw-r--r--src/containers/auth/Login.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/containers/auth/Login.js b/src/containers/auth/Login.js
index 358ea7e9..f1deb33c 100644
--- a/src/containers/auth/Login.js
+++ b/src/containers/auth/Login.js
@@ -2,7 +2,7 @@ import PropTypes from "prop-types";
import React from "react";
import GoogleLogin from "react-google-login";
import {connect} from "react-redux";
-import {completeLogin} from "../../actions/auth";
+import {logIn} from "../../actions/auth";
class LoginContainer extends React.Component {
static propTypes = {
@@ -12,8 +12,11 @@ class LoginContainer extends React.Component {
onAuthResponse(response) {
this.props.onLogin({
+ email: response.getBasicProfile().getEmail(),
+ givenName: response.getBasicProfile().getGivenName(),
+ familyName: response.getBasicProfile().getFamilyName(),
googleId: response.googleId,
- authToken: response.accessToken,
+ authToken: response.getAuthResponse().id_token,
expiresAt: response.getAuthResponse().expires_at
});
}
@@ -44,7 +47,7 @@ const mapStateToProps = (state, ownProps) => {
const mapDispatchToProps = dispatch => {
return {
- onLogin: (payload) => dispatch(completeLogin(payload)),
+ onLogin: (payload) => dispatch(logIn(payload)),
};
};