Skip to content

Commit 068be1f

Browse files
committed
docs: update docs
1 parent 81d2d75 commit 068be1f

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

docs/getting_started/install.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ your project.
7272

7373
### Manual Setup
7474

75-
1. Copy the **Auth.php**, **AuthGroups.php**, and **AuthToken.php** from **vendor/codeigniter4/shield/src/Config/** into your project's config folder and update the namespace to `Config`. You will also need to have these classes extend the original classes. See the example below. These files contain all the settings, group, and permission information for your application and will need to be modified to meet the needs of your site.
75+
1. **Config Setup:**
76+
Copy the **Auth.php**, **AuthGroups.php**, and **AuthToken.php** from **vendor/codeigniter4/shield/src/Config/** into your project's config folder and update the namespace to `Config`. You will also need to have these classes extend the original classes. See the example below. These files contain all the settings, group, and permission information for your application and will need to be modified to meet the needs of your site.
7677

7778
```php
7879
// new file - app/Config/Auth.php
@@ -91,29 +92,26 @@ your project.
9192
}
9293
```
9394

94-
2. **Helper Setup** The `setting` helper needs to be included in almost every page. The simplest way to do this is to add it to the `BaseController::initController()` method:
95+
2. **Helper Setup:**
96+
The `auth` and `setting` helpers need to be included in almost every page.
97+
The simplest way to do this is to add it to the **app/Config/Autoload.php** file:
9598

9699
```php
97-
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
98-
{
99-
$this->helpers = array_merge($this->helpers, ['setting']);
100-
101-
// Do Not Edit This Line
102-
parent::initController($request, $response, $logger);
103-
}
100+
public $helpers = ['auth', 'setting'];
104101
```
105102

106-
This requires that all of your controllers extend the `BaseController`, but that's a good practice anyway.
107-
108-
3. **Routes Setup** The default auth routes can be setup with a single call in **app/Config/Routes.php**:
103+
3. **Routes Setup:**
104+
The default auth routes can be setup with a single call in **app/Config/Routes.php**:
109105

110106
```php
111107
service('auth')->routes($routes);
112108
```
113109

114-
4. **Security Setup** Set `Config\Security::$csrfProtection` to `'session'` for security reasons, if you use Session Authenticator.
110+
4. **Security Setup:**
111+
Set `Config\Security::$csrfProtection` to `'session'` for security reasons, if you use Session Authenticator.
115112

116-
5. Configure **app/Config/Email.php** to allow Shield to send emails with the [Email Class](https://codeigniter.com/user_guide/libraries/email.html).
113+
5. **Email Setup:**
114+
Configure **app/Config/Email.php** to allow Shield to send emails.
117115

118116
```php
119117
<?php
@@ -130,7 +128,8 @@ your project.
130128
}
131129
```
132130

133-
6. **Migration** Run the migrations.
131+
6. **Migration:**
132+
Run the migrations.
134133

135134
!!! note
136135

docs/references/authentication/authentication.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ auth()->getProvider();
4848

4949
!!! note
5050

51-
The `auth_helper` is autoloaded by Composer. If you want to *override* the functions,
52-
you need to define them in **app/Common.php**.
51+
The `auth_helper` is autoloaded by CodeIgniter's autoloader if you follow the
52+
installation instruction. If you want to *override* the functions, create
53+
**app/Helpers/auth_helper.php**.
5354

5455
## Authenticator Responses
5556

0 commit comments

Comments
 (0)