diff --git a/client/src/auth/Auth.js b/client/src/auth/Auth.js
index 44488c4ef..4a62b8251 100644
--- a/client/src/auth/Auth.js
+++ b/client/src/auth/Auth.js
@@ -101,8 +101,9 @@ class Auth {
this.signinOrCreateAccount({ ...data })
this.cb(data)
- console.log(authResult.idTokenPayload)
+ console.log('idTokenPayload', authResult.idTokenPayload)
setItem('authUser', JSON.stringify(authResult.idTokenPayload))
+ setItem('authId', authResult.idTokenPayload.sub)
if (window.location.href.includes(`callback`)) {
window.location.href = '/'
}
@@ -127,6 +128,7 @@ class Auth {
console.log('signinOrCreateAccount auth: ', await data)
setItem('authUser', JSON.stringify(data.data.authenticate))
+ setItem('authId', data.data.authenticate.authId)
if (window.location.href.includes(`callback`)) {
window.location.href = '/'
} else {
@@ -169,6 +171,7 @@ class Auth {
.then(result => {
console.log('handleAuth.checksessions: ', result)
setItem('authUser', result.idTokenPayload.sub)
+ setItem('authId', result.idTokenPayload.sub)
// user confirmed, log into client
this.setSession(result)
return result.idTokenPayload
diff --git a/client/src/components/Home.js b/client/src/components/Home.js
index 71dfc717b..9d3e35e6e 100644
--- a/client/src/components/Home.js
+++ b/client/src/components/Home.js
@@ -90,17 +90,7 @@ class Home extends Component {
Currently you can use the Browse section to list all registered users. At the Search page you can searh for users by name. Clicking on View Profile you can see some more info about that user. You can signup with your Github account and manage your profile information while logged in. While loggedin, you can edit your profile info, define your referrer and view your descendants. You will find all features under develpment with a dialog indicating it is not ready.
-
- What is next?
-
-
- The major features for the 3rd sprint are:
-
-
- - 1. Managing profile images.
- - 2. Making sure that Auth0 integration server side is working well.
- - 3. Making sure that mutations can not be impersonated.
-
+
diff --git a/client/src/components/LoggedInUser.js b/client/src/components/LoggedInUser.js
index 8c06db481..656b66927 100644
--- a/client/src/components/LoggedInUser.js
+++ b/client/src/components/LoggedInUser.js
@@ -30,9 +30,12 @@ class LoggedInUser extends Component {
user.lastName !== ''
) { displayName = user.firstName + ' ' + user.lastName }
+ let authArray = this.props.authId.split('|')
+ let identityProvider = authArray[0]
+
return (
)
} else {
diff --git a/client/src/components/LoggedInUserMenu.js b/client/src/components/LoggedInUserMenu.js
index 0f5032229..692af39ff 100644
--- a/client/src/components/LoggedInUserMenu.js
+++ b/client/src/components/LoggedInUserMenu.js
@@ -13,6 +13,7 @@ import MenuItem from '@material-ui/core/MenuItem'
// Images
import GithubLogo from '../img/github-head-negative.png'
+import EmailIcon from '../img/email.png'
import ProfileIcon from '@material-ui/icons/Person'
import LogoutIcon from '@material-ui/icons/DirectionsWalk'
@@ -39,6 +40,24 @@ class LoggedInUserMenu extends Component {
}
}
+ displayIdentityProvider () {
+ const { classes } = this.props
+ switch (this.props.identityProvider) {
+ case 'github':
+ return (
+
+ )
+ break
+ case 'auth0':
+ return (
+
+ )
+ break
+ default:
+
+ }
+ }
+
render () {
const { classes } = this.props
return (
@@ -59,7 +78,7 @@ class LoggedInUserMenu extends Component {
}}
color='inherit'
>
-
+ {this.displayIdentityProvider()}
{this.props.menuLabel}