Skip to content

Commit

Permalink
fix: tweak auth messaging
Browse files Browse the repository at this point in the history
  • Loading branch information
ginatrapani committed Feb 28, 2019
1 parent 66e5319 commit 6cd14d3
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 16 deletions.
23 changes: 15 additions & 8 deletions frontend-graphql/src/components/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,22 +205,29 @@ class Home extends Component {
</li>
))}
</ul>
<p>
You are looking at the GraphQL-powered React frontend. Be sure to
also check out the{' '}
<a href="http://localhost:3000/">REST-powered frontend</a>.
</p>
{authToken ? (
<div>
<h2>You Are Logged In</h2>
<p>
Using an authenticated query, we got your id:{' '}
<span>{userId}</span>
Your user ID is <span>{userId}</span>, retrieved via an
authenticated API query.
</p>
</div>
) : (
''
<div>
<h2>You Are Not Logged In</h2>
<p>
The frontend is not making authenticated API requests.{' '}
<a href="/login">Log in.</a>
</p>
</div>
)}
<h2>Where You're At</h2>
<p>
You are looking at the GraphQL-powered React frontend. Be sure to
also check out the{' '}
<a href="http://localhost:3000/">REST-powered frontend</a>.
</p>
</div>
</div>
);
Expand Down
23 changes: 15 additions & 8 deletions frontend/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,22 +120,29 @@ class Index extends Component {
{fposts}
<h2>Pages</h2>
{fpages}

<p>
You are looking at the REST API-powered React frontend. Be sure to
also check out the{' '}
<a href="http://localhost:3001/">GraphQL-powered frontend</a>.
</p>
{id ? (
<div>
<h2>You Are Logged In</h2>
<p>
Using an authenticated query, we got your id: <span>{id}</span>
Your user ID is <span>{id}</span>, retrieved via an authenticated
API query.
</p>
</div>
) : (
''
<div>
<h2>You Are Not Logged In</h2>
<p>
The frontend is not making authenticated API requests.{' '}
<a href="/login">Log in.</a>
</p>
</div>
)}
<h2>Where You're At</h2>
<p>
You are looking at the REST API-powered React frontend. Be sure to
also check out the{' '}
<a href="http://localhost:3001/">GraphQL-powered frontend</a>.
</p>
</Layout>
);
}
Expand Down

0 comments on commit 6cd14d3

Please sign in to comment.