Skip to content

Commit

Permalink
Merge branch 'canary' into referrer
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Nov 15, 2021
2 parents aadc0a4 + 7d82e07 commit abb33f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
7 changes: 2 additions & 5 deletions docs/authentication.md
Expand Up @@ -48,7 +48,7 @@ const Profile = () => {
export default Profile
```

You can view this [example in action](https://next-with-iron-session.vercel.app/). Check out the [`with-iron-session`](https://github.com/vercel/next.js/tree/canary/examples/with-iron-session) example to see how it works.
You can view this [example in action](https://iron-session-example.vercel.app/). Check out the [`with-iron-session`](https://github.com/vercel/next.js/tree/canary/examples/with-iron-session) example to see how it works.

### Authenticating Server-Rendered Pages

Expand All @@ -71,10 +71,7 @@ import withSession from '../lib/session'
import Layout from '../components/Layout'

export const getServerSideProps = withSession(async function ({ req, res }) {
// Get the user's session based on the request
const user = req.session.get('user')

if (!user) {
if (!req.session.user) {
return {
redirect: {
destination: '/login',
Expand Down
8 changes: 4 additions & 4 deletions docs/routing/introduction.md
Expand Up @@ -6,7 +6,7 @@ description: Next.js has a built-in, opinionated, and file-system based Router.

Next.js has a file-system based router built on the [concept of pages](/docs/basic-features/pages.md).

When a file is added to the `pages` directory it's automatically available as a route.
When a file is added to the `pages` directory, it's automatically available as a route.

The files inside the `pages` directory can be used to define most common patterns.

Expand All @@ -19,14 +19,14 @@ The router will automatically route files named `index` to the root of the direc

#### Nested routes

The router supports nested files. If you create a nested folder structure files will be automatically routed in the same way still.
The router supports nested files. If you create a nested folder structure, files will automatically be routed in the same way still.

- `pages/blog/first-post.js``/blog/first-post`
- `pages/dashboard/settings/username.js``/dashboard/settings/username`

#### Dynamic route segments

To match a dynamic segment you can use the bracket syntax. This allows you to match named parameters.
To match a dynamic segment, you can use the bracket syntax. This allows you to match named parameters.

- `pages/blog/[slug].js``/blog/:slug` (`/blog/hello-world`)
- `pages/[username]/settings.js``/:username/settings` (`/foo/settings`)
Expand Down Expand Up @@ -68,7 +68,7 @@ function Home() {
export default Home
```

In the example above we have multiple links, each one maps a path (`href`) to a known page:
The example above uses multiple links. Each one maps a path (`href`) to a known page:

- `/``pages/index.js`
- `/about``pages/about.js`
Expand Down

0 comments on commit abb33f0

Please sign in to comment.