You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: adminforth/documentation/docs/tutorial/03-Customization/06-customPages.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -472,13 +472,13 @@ Add to your `<script setup>` section:
472
472
import { Link } from'@/afcl';
473
473
```
474
474
475
-
If you set `customLayout:true` in the `meta` object, it will not include default layout like sidebar and header, so you can create your own layout for this page.
475
+
If you set `sidebarAndHeader:'none'` in the `meta` object, it will not include default layout like sidebar and header, so you can create your own layout for this page.
476
476
477
477
### Disable redirects to login page (Public pages)
478
478
479
479
Any route which has sidebar and header (e.g. default CRUD pages or menu item with `component`) uses internal AdminForth REST API to fetch menu items and user information, so it passes authentication check and if authentication cookie is not provided or has expired JWT user gets redirected to the login page.
480
480
481
-
In case if you set `customLayout:true`, it will not call these APIs so user will not be automatically redirected to the login page in case of expired or not-provided authentication cookie. That feature allows you to implement public pages without authentication, e.g. Terms of Service, Privacy Policy and many others. In case if you need to check if user is logged in just call any custom API which has `admin.express.authorize` middleware. Obviously for public pages if they use any APIs you should create API endpoint WITHOUT `admin.express.authorize` middleware.
481
+
In case if you set `sidebarAndHeader:'none'`, it will not call these APIs so user will not be automatically redirected to the login page in case of expired or not-provided authentication cookie. That feature allows you to implement public pages without authentication, e.g. Terms of Service, Privacy Policy and many others. In case if you need to check if user is logged in just call any custom API which has `admin.express.authorize` middleware. Obviously for public pages if they use any APIs you should create API endpoint WITHOUT `admin.express.authorize` middleware.
482
482
483
483
> Please note that AdminForth uses classic SPA Vue app, so even public pages will be rendered by JavaScript in the browser and not on the server side. If your public page should be indexed by search engines, you should use some SSR framework like Nuxt.js to create such pages. At the same time public pages can still be usefull if you don't focus on old-fashioned search engines (modern search engines can index SPA pages as well) or if indexing is not important for such pages at all (e.g. Terms of Service, Privacy Policy, Contact Us and many others).
484
484
@@ -497,7 +497,7 @@ You can add custom meta attributes to the page by passing `meta` object to the p
497
497
file:'@@/pages/TwoFactorsSetup.vue',
498
498
meta: {
499
499
title:'Setup 2FA', // meta title for this page
500
-
customLayout:true,// don't include default layout like menu/header
500
+
sidebarAndHeader:'none', // don't include default layout like menu/header
0 commit comments