我正在使用firebase来获取谷歌登录,我需要帮助获取谷歌分配给主页的用户ID。当有人使用他们的谷歌ID登录时,他们会被重定向到我的主页。我希望页面也想让显示器问好,xxxxxxx
这是我到目前为止的标题
import React from 'react';
import { NavLink } from 'react-router-dom';
import { connect } from 'react-redux';
import { startLogout, googleAuthProvider } from '../actions/auth';
import { Route, Redirect } from 'react-router';
const Header = ({ startLogout, googleAuthProvider }) => (
<header className="header">
<h1 className="header__title">Journal Example App</h1>
<p>Hello, {googleAuthProvider.login}</p>
<div className="center-spread">
<NavLink to="/" activeClassName="is-active" className="button center-spread" exact={true}>Dashboard</NavLink>
<NavLink to="/create" activeClassName="is-active" className="button center-spread" >Create Topic</NavLink>
<NavLink to="/topics" activeClassName="is-active" className="button center-spread" >Footnotes</NavLink>
<button className="button" onClick={startLogout} >Logout</button>
</div>
</header>
);
const mapDispatchToProps = (dispatch) => ({
startLogout: () => dispatch(startLogout())
});
export default connect(undefined, mapDispatchToProps)(Header);
为什么google auth提供商会给我列出的用户名?我正在使用firebase获取信息,这让我疯狂了一下。