diff --git a/frontend/src/App.js b/frontend/src/App.js
index 7c0edab9c9..2d9c321429 100644
--- a/frontend/src/App.js
+++ b/frontend/src/App.js
@@ -14,11 +14,12 @@ import { TopBanner } from './TopBanner'
import { PhaseBanner } from './PhaseBanner'
import { Footer } from './Footer'
import { Navigation } from './Navigation'
-import { Flex, Link, CSSReset, useToast } from '@chakra-ui/core'
+import { Flex, Link, CSSReset } from '@chakra-ui/core'
import { SkipLink } from './SkipLink'
-import { useQuery, useApolloClient } from '@apollo/react-hooks'
+import { useQuery } from '@apollo/react-hooks'
import gql from 'graphql-tag'
import { TwoFactorNotificationBar } from './TwoFactorNotificationBar'
+import { UserPage } from './UserPage'
import { UserList } from './UserList'
import { DmarcReportPage } from './DmarcReportPage'
@@ -29,12 +30,15 @@ export default function App() {
{
jwt @client
tfa @client
+ userName @client
}
`
const { i18n } = useLingui()
- const toast = useToast()
- const client = useApolloClient()
- const { data } = useQuery(GET_JWT_TOKEN)
+ const { data, loading } = useQuery(GET_JWT_TOKEN)
+
+ if (loading) {
+ return
Loading...
+ }
return (
<>
@@ -68,21 +72,8 @@ export default function App() {
Sign In
) : (
- {
- // This clears the JWT, essentially logging the user out in one go
- client.writeData({ data: { jwt: null } }) // How is this done?
- toast({
- title: 'Sign Out.',
- description: 'You have successfully been signed out.',
- status: 'success',
- duration: 9000,
- isClosable: true,
- })
- }}
- >
- Sign Out
+
+ User Profile
)}
@@ -103,6 +94,10 @@ export default function App() {
+
+
+
+
diff --git a/frontend/src/DomainsPage.js b/frontend/src/DomainsPage.js
index e1c1961fe0..f4774fe62d 100644
--- a/frontend/src/DomainsPage.js
+++ b/frontend/src/DomainsPage.js
@@ -23,10 +23,10 @@ export function DomainsPage() {
This is the full list of domains
- {data.domains.map((domain, i) => {
+ {data.domains.edges.map((edge, i) => {
return (
-
- {domain.url}
+
+ {edge.node.url}
)
})}
diff --git a/frontend/src/SignInPage.js b/frontend/src/SignInPage.js
index 246bfe464e..79abaa8969 100644
--- a/frontend/src/SignInPage.js
+++ b/frontend/src/SignInPage.js
@@ -36,7 +36,8 @@ export function SignInPage() {
cache.writeData({
data: {
jwt: signIn.authToken,
- tfa: signIn.user.tfaValidated,
+ tfa: signIn.user.tfa,
+ userName: signIn.user.userName,
},
})
},
@@ -92,7 +93,7 @@ export function SignInPage() {
{(props) => (
// Needed for testing library
// eslint-disable-next-line jsx-a11y/no-redundant-roles
-