react-firestore-authentication icon indicating copy to clipboard operation
react-firestore-authentication copied to clipboard

How to access user collection attributes from authUser uid

Open MincePie opened this issue 5 years ago • 0 comments

I am really stuck in trying to figure out how to use the AuthUserContext to get to the attributes stored in the user collection for the user with the uid from the authUser.

I can do:

[import React from 'react'; import { compose } from 'recompose'; import { Divider, Layout, Card, Tabs, Typography } from 'antd'; import { AuthUserContext, withAuthorization, withEmailVerification } from '../Session/Index';

const Dashboard = () => (

<AuthUserContext.Consumer> {authUser => (

<div>
{authUser.email}
   </div>
)}

</AuthUserContext.Consumer> );

const condition = authUser => !!authUser; export default compose( withEmailVerification, withAuthorization(condition), )(Dashboard); ](url)

What I want to do is get from authUser to the user collection attributes such as: title so that i can somehow display the user information for the currently authorised user.

Has anyone figured out how to do this?

MincePie avatar Jan 10 '20 00:01 MincePie