components APIs
- SEO
- Nav
- Header
- Button
- TagsBlock
- Link
- Alert
- Sidebar
- A
- Login
- Signup
- Chat
- App
- Layout
- BlogList
- RouteGuard
- Spinner
- Profile
- InfoBox
- Widget
- SimpleTable
- SimpleLineChart
- SimpleRandarChart
- SimpleBarChart
- PageTitle
- EnhancedTable
- BaseChartCard
- FullPageSpinner
- CodeChangesGraph
- CodeChangesLineGraph
- ActivityDatesAndTimesGraph
- TimeToFirstResponseGraph
- ContributorsTable
- IssuesNewGraph
- IssuesClosedGraph
- IssuesActiveGraph
- IssuesAgeGraph
- IssuesResponseTimeGraph
- IssuesResolutionDurationGraph
- SearchInput
- ReviewsAcceptedGraph
- ReviewsDeclinedGraph
- ReviewsDurationGraph
- IntegrationCard
- GithubLogin
- Tasks
- CustomInput
- RegularCard
- Table
- ItemGrid
- HeaderLinks
- Footer
- StatsCard
- ChartCard
- P
- Small
- SnackbarContent
- Snackbar
- Quote
- Muted
- Primary
- Info
- Success
- Warning
- Danger
- Tabs
- Tab
- T
- Message
- FieldSet
- Form
- Modal
- CenteredCard
- CardHeader
- CardContent
- WithLoader
- List
- Icon
- ListHeader
- ListItem
- ListColumn
- DropdownMenu
- DropdownMenuItem
- withRouter
- withSettings
- withForm
- withActions
- RetractingLabelInput
- ErrorFor
- CardFooter
- SubmitField
- BarChart
- Card
- Title
- RichSelect
- Label
- Switch
- CardNav
- ButtonIcon
- TopNavbar
- SidebarContainer
- NotFound
- Store
- Router
- MainErrorBoundary
- Settings
- ExternalSettings
- FormField
- Avatar
- AvatarGroup
- Flex
- IconButton
- LeftRail
- ChatToolbar
- ChatInput
- MessageList
- ImageUpload
- ChatAvatar
- SearchUsers
- ChatList
- RailHeader
- Checkbox
- Filters
- ProductsGrid
- CartContents
- HomepageCollectionsGrid
- FeaturedProducts
- ImageGallery
- ProductQuantityAdder
OtherRelated APIs
components#RouteGuard JavaScript Examples
The following examples show how to use
components#RouteGuard.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: _app.js From next-js-11-basic-authentication-example with MIT License | 6 votes |
function App({ Component, pageProps }) {
return (
<>
<Head>
<title>Next.js 11 - Basic HTTP Authentication Example</title>
{/* eslint-disable-next-line @next/next/no-css-tags */}
<link href="//netdna.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet" />
</Head>
<div className="app-container bg-light">
<Nav />
<div className="container pt-4 pb-4">
<RouteGuard>
<Component {...pageProps} />
</RouteGuard>
</div>
</div>
{/* credits */}
<div className="text-center mt-4">
<p>
<a href="https://jasonwatmore.com/post/2021/08/29/next-js-basic-http-authentication-tutorial-with-example-app" target="_top">Next.js 11 - Basic Authentication Tutorial with Example App</a>
</p>
<p>
<a href="https://jasonwatmore.com" target="_top">JasonWatmore.com</a>
</p>
</div>
</>
);
}