Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion docs/customization/login_identifier.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
# Customizing Login Identifier

If your application has a need to use something other than `email` or `username`, you may specify any valid column within the `users` table that you may have added. This allows you to easily use phone numbers, employee or school IDs, etc. as the user identifier. You must implement the following steps to set this up:
If your application has a need to use something other than `email` or `username`, you may specify any valid column within the `users` table that you may have added.

This allows you to easily use phone numbers, employee or school IDs, etc. as the user identifier.
You must implement the following steps to set this up.

This only works with the Session authenticator.

!!! note

By default, Shield requires users to register their email and password.
Further customization is required beyond the steps on this page to remove
emails from user registrations.

## Create Migration File

Create a [migration](http://codeigniter.com/user_guide/dbmgmt/migration.html) that
Expand Down Expand Up @@ -39,6 +48,12 @@ public array $validFields = [
You must write new **Validation Rules** and then set them using the
[Customizing Validation Rules](./validation_rules.md#login) description.

!!! note

Not only the Validation Rules for **login**, but also the rules for
[registration](./validation_rules.md#registration) should be updated. If you do
not add the new **Validation Rules**, the new field will not be saved to the database.

## Customize Login View

1. Change the `login` view file in the **app/Config/Auth.php** file.
Expand Down