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/NavBar.js b/client/src/components/NavBar.js
index 1853c20c2..ebd5ae5dd 100644
--- a/client/src/components/NavBar.js
+++ b/client/src/components/NavBar.js
@@ -56,20 +56,9 @@ class NavBar extends Component {
}
componentDidMount () {
- const userStored = localStorage.getItem('authUser')
-
- if (userStored !== null && userStored !== undefined && userStored !== 'undefined') {
- const user = JSON.parse(userStored)
-
- /* For some reason, the result of GraphQL some times varies, that is why I had to do the following hack. */
-
- let authId
- if (user.authId === undefined) {
- authId = user.sub
- } else {
- authId = user.authId
- }
+ const authId = localStorage.getItem('authId')
+ if (authId !== null && authId !== undefined && authId !== 'undefined') {
this.setState({ authId: authId })
}
}
diff --git a/client/src/components/ProfileSheet.js b/client/src/components/ProfileSheet.js
index f0f42299a..3e4b99539 100644
--- a/client/src/components/ProfileSheet.js
+++ b/client/src/components/ProfileSheet.js
@@ -241,16 +241,14 @@ class ProfileSheet extends Component {
componentWillMount () {
if (this.defaultValuesSet === false) {
- let authUserData = localStorage.getItem('authUser')
+ let authId = localStorage.getItem('authId')
let userData = localStorage.getItem('loggedInUser')
- if (userData === 'undefined' || authUserData === 'undefined') { return }
+ if (userData === 'undefined') { return }
let user = JSON.parse(userData)
this.defaultValuesSet = true
- let authUser = JSON.parse(authUserData)
-
/* To avoid console warning, we need to take care of the fields that are null. */
if (user.firstName === null) { user.firstName = '' }
@@ -273,30 +271,33 @@ class ProfileSheet extends Component {
isTrader: user.isTrader,
isDataAnalyst: user.isDataAnalyst,
roleId: user.role.id,
- authId: authUser.authId
+ authId: authId
})
}
}
displayIdentityProvider () {
const { classes } = this.props
+ let authId = this.state.authId
+ console.log('state', this.state)
+ if (authId !== undefined) {
+ let authArray = this.state.authId.split('|')
+ let identityProvider = authArray[0]
- let authArray = this.state.authId.split('|')
- let identityProvider = authArray[0]
-
- switch (identityProvider) {
- case 'github':
- return (
-
- )
- break
- case 'auth0':
- return (
-
- )
- break
- default:
+ switch (identityProvider) {
+ case 'github':
+ return (
+
+ )
+ break
+ case 'auth0':
+ return (
+
+ )
+ break
+ default:
+ }
}
}
diff --git a/client/src/views/footer/index.js b/client/src/views/footer/index.js
index 94fb59e20..dc9fd728f 100644
--- a/client/src/views/footer/index.js
+++ b/client/src/views/footer/index.js
@@ -58,7 +58,17 @@ const Footer = ({ classes }) => {
- Users
+ Browse
+
+
+
+
+ Search
+
+
+
+
+ Contact
@@ -68,15 +78,11 @@ const Footer = ({ classes }) => {
-
-
+
+
Support
-
+
{
Documentation
-
+
Telegram
-
+