Need react version of providing user info
Closed this issue · 4 comments
This is an enhancement
[ x] Feature request
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Documentation issue or request
Description
DV needs access to the userinfo. @gashcrumb has pointed to the following that could be ported over:
https://github.com/syndesisio/syndesis/blob/master/app/ui/src/app/core/providers/user-provider.service.ts#L24
@seanforyou23 FYI we'll need this also for showing the right user in the nav bar.
I'd probably create a WithUser
component that just makes the response from /users/~
available. It'll be a lot like this one as the API just returns a simple object that looks like { username: "foo" }
afaik.
For logout eventually I'd probably create a WithUserHelpers
and it'd look similar to this file and put the code for logout in there ultimately. But I'd say focus on WithUsers
for this issue.
Also we could probably just set this user in the AppContext using WithUser
by adding it around here, that way we don't need to invoke that API, instead code that needs the user name can use an AppContext.Consumer
.
Also we could probably just set this user in the AppContext using
WithUser
by adding it around here , that way we don't need to invoke that API, instead code that needs the user name can use anAppContext.Consumer
.
+1