Skip to content

Commit

Permalink
Authentication tutorial - small fixes (gatsbyjs#9738)
Browse files Browse the repository at this point in the history
- Changed gatsbyjs.org links from absolute to relative
- Fixed passportjs link
- Changed sidebar link to show as available content (dark)
  • Loading branch information
ManoelLobo authored and gpetrioli committed Jan 22, 2019
1 parent e2e478b commit dad2f95
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions docs/docs/authentication-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
title: Making a site with user authentication
---

Sometimes, you need to create a site with gated content, available only to authenticated users. Using Gatsby, you may achieve this using the concept of [client-only routes](https://www.gatsbyjs.org/docs/building-apps-with-gatsby/#client-only-routes), to define which pages a user can view only after logging in.
Sometimes, you need to create a site with gated content, available only to authenticated users. Using Gatsby, you may achieve this using the concept of [client-only routes](/docs/building-apps-with-gatsby/#client-only-routes), to define which pages a user can view only after logging in.

## Prerequisites

You should have already configured your environment to be able to use the `gatsby-cli`. A good starting point is the [main tutorial](https://www.gatsbyjs.org/tutorial/).
You should have already configured your environment to be able to use the `gatsby-cli`. A good starting point is the [main tutorial](/tutorial).

## Security notice

In production, you should use a tested and robust solution to handle the authentication. [Auth0](https://www.auth0.com), [Firebase](https://firebase.google.com), and [Passport.js](passportjs.org) are good examples. This tutorial will only cover the authentication workflow, but you should take the security of your app as seriously as possible.
In production, you should use a tested and robust solution to handle the authentication. [Auth0](https://www.auth0.com), [Firebase](https://firebase.google.com), and [Passport.js](http://passportjs.org) are good examples. This tutorial will only cover the authentication workflow, but you should take the security of your app as seriously as possible.

## Building your Gatsby app

Expand Down Expand Up @@ -200,7 +200,7 @@ exports.onCreatePage = async ({ page, actions }) => {
}
```

> Note: There is a convenient plugin that already does this work for you: [gatsby-plugin-create-client-paths](https://www.gatsbyjs.org/packages/gatsby-plugin-create-client-paths/)
> Note: There is a convenient plugin that already does this work for you: [gatsby-plugin-create-client-paths](/packages/gatsby-plugin-create-client-paths)
Now, you must create a generic page that will have the task to generate the restricted content:

Expand Down
2 changes: 1 addition & 1 deletion www/src/data/sidebars/doc-links.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@
link: /docs/behind-the-scenes-terminology/
- title: Advanced Tutorials
items:
- title: Making a site with user authentication*
- title: Making a site with user authentication
link: /docs/authentication-tutorial/
- title: Making an e-commerce Gatsby site
link: /docs/ecommerce-tutorial/
Expand Down

0 comments on commit dad2f95

Please sign in to comment.