Skip to content

Commit

Permalink
Merge pull request #570 from kenjis/fix-docs-add-config-email
Browse files Browse the repository at this point in the history
docs: add configuration for Config\Email
  • Loading branch information
kenjis authored Dec 26, 2022
2 parents ca7335c + 02c36a8 commit 3fede09
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
50 changes: 50 additions & 0 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,31 @@ Require it with an explicit version constraint allowing its desired stability.
php spark shield:setup
```

2. Configure `app/Config/Email.php` to allow Shield to send emails with the [Email Class](https://codeigniter.com/user_guide/libraries/email.html).

```php
<?php

namespace Config;

use CodeIgniter\Config\BaseConfig;

class Email extends BaseConfig
{
/**
* @var string
*/
public $fromEmail = 'your_mail@example.com';

/**
* @var string
*/
public $fromName = 'your name';

// ...
}
```

### Manual Setup

There are a few setup items to do before you can start using Shield in
Expand Down Expand Up @@ -134,6 +159,31 @@ your project.

1. Use InnoDB, not MyISAM.

6. Configure `app/Config/Email.php` to allow Shield to send emails.

```php
<?php

namespace Config;

use CodeIgniter\Config\BaseConfig;

class Email extends BaseConfig
{
/**
* @var string
*/
public $fromEmail = 'your_mail@example.com';

/**
* @var string
*/
public $fromName = 'your name';

// ...
}
```

## Controller Filters
The [Controller Filters](https://codeigniter.com/user_guide/incoming/filters.html) you can use to protect your routes the shield provides are:

Expand Down
6 changes: 6 additions & 0 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ public int $unusedTokenLifetime = YEAR;

### Enable Account Activation via Email

> **Note** You need to configure `app/Config/Email.php` to allow Shield to send emails. See [Installation](install.md#initial-setup).
By default, once a user registers they have an active account that can be used. You can enable Shield's built-in, email-based activation flow within the `Auth` config file.

```php
Expand All @@ -120,6 +122,8 @@ public array $actions = [

### Enable Two-Factor Authentication

> **Note** You need to configure `app/Config/Email.php` to allow Shield to send emails. See [Installation](install.md#initial-setup).
Turned off by default, Shield's Email-based 2FA can be enabled by specifying the class to use in the `Auth` config file.

```php
Expand All @@ -131,6 +135,8 @@ public array $actions = [

### Responding to Magic Link Logins

> **Note** You need to configure `app/Config/Email.php` to allow Shield to send emails. See [Installation](install.md#initial-setup).
Magic Link logins allow a user that has forgotten their password to have an email sent with a unique, one-time login link. Once they've logged in you can decide how to respond. In some cases, you might want to redirect them to a special page where they must choose a new password. In other cases, you might simply want to display a one-time message prompting them to go to their account page and choose a new password.

#### Session Notification
Expand Down

0 comments on commit 3fede09

Please sign in to comment.