From e4f8673eabc8da87043143a23a60f63fa85ec79f Mon Sep 17 00:00:00 2001 From: Marco Date: Thu, 3 Aug 2017 22:02:09 +0200 Subject: [PATCH] Remove documentation on half-baked support for multi-factor auth --- README.md | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/README.md b/README.md index f20c2f5..c388360 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,6 @@ Migrating from an earlier version of this project? See our [upgrade guide](Migra * [Creating a random string](#creating-a-random-string) * [Creating a UUID v4 as per RFC 4122](#creating-a-uuid-v4-as-per-rfc-4122) * [Reading and writing session data](#reading-and-writing-session-data) - * [Implementing multi-factor authentication](#implementing-multi-factor-authentication) ### Creating a new instance @@ -805,24 +804,6 @@ $uuid = \Delight\Auth\Auth::createUuid(); For detailed information on how to read and write session data conveniently, please refer to [the documentation of the session library](https://github.com/delight-im/PHP-Cookie#reading-and-writing-session-data), which is included by default. -### Implementing multi-factor authentication - -You can pass a callback, e.g. an anonymous function, to the two methods `login` or `loginWithUsername` as their fourth parameter. Such a callback could look like this: - -```php -function ($userId) { - // ... - - return false; - // or - // return true; -} -``` - -The callback will be executed if (and only if) authentication is successful, but it will run *right before* completing authentication. This lets you hook into the login flow. - -In that callback, you receive the authenticating user's ID as the only parameter. Return `true` from the callback to let authentication proceed, or return `false` to cancel the attempt. Be ready to catch the `AttemptCancelledException` in the latter case. - ## Frequently asked questions ### What about password hashing?