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 ( + Github + ) + break + case 'auth0': + return ( + Auth0 + ) + break + default: + + } + } + render () { const { classes } = this.props return ( @@ -59,7 +78,7 @@ class LoggedInUserMenu extends Component { }} color='inherit' > - Github + {this.displayIdentityProvider()} {this.props.menuLabel} diff --git a/client/src/img/email.png b/client/src/img/email.png new file mode 100644 index 000000000..93b2edf0c Binary files /dev/null and b/client/src/img/email.png differ diff --git a/server/schema/schema.js b/server/schema/schema.js index b85a5b5a6..1ef24b2ae 100644 --- a/server/schema/schema.js +++ b/server/schema/schema.js @@ -425,7 +425,10 @@ function authenticate (encodedToken, callBackFunction) { let authArray = authId.split('|') let socialAccountProvider = authArray[0] - if (socialAccountProvider !== 'github') { + if ( + socialAccountProvider !== 'github' && + socialAccountProvider !== 'auth0' + ) { if (global.ERROR_LOG === true) { console.log('[ERROR] ' + MODULE_NAME + ' -> authenticate -> onValidated -> onUserFound -> Social Account Provider not Supoorted. ') } if (global.ERROR_LOG === true) { console.log('[ERROR] ' + MODULE_NAME + ' -> authenticate -> onValidated -> onUserFound -> socialAccountProvider = ' + socialAccountProvider) }