summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Cornutt <chris.cornutt@hp.com>2015-02-04 15:00:58 -0600
committerChris Cornutt <chris.cornutt@hp.com>2015-02-04 15:00:58 -0600
commit9c3c126d98b97c462363977dd322b073883e370d (patch)
treea42204a9e5d435f46e63a84a93bc462ab871cb79
parente9eb21d57ee3fe3e65b5d63bb0170c8122b2a589 (diff)
downloadgatekeeper-9c3c126d98b97c462363977dd322b073883e370d.zip
gatekeeper-9c3c126d98b97c462363977dd322b073883e370d.tar.gz
gatekeeper-9c3c126d98b97c462363977dd322b073883e370d.tar.bz2
adding information to the authentication docs about enabling the "remember me" on auth
-rw-r--r--docs/authentication.md18
1 files changed, 18 insertions, 0 deletions
diff --git a/docs/authentication.md b/docs/authentication.md
index b333bcd..84b6f41 100644
--- a/docs/authentication.md
+++ b/docs/authentication.md
@@ -53,3 +53,21 @@ if (Gatekeeper::rememberMe($user, $config) === true) {
```
The `interval` format here is any supported by the [PHP DateTime handling](http://php.net/manual/en/datetime.formats.php) in the constructor.
+
+#### Remember Me & Authentication
+
+In addition to the more manual handling of the "remember me" functionality above, you can also have the `authenicate` method kick off the process when the user successfully authenticates with a second optional parameter:
+
+```
+<?php
+$credentials = array(
+ 'username' => 'ccornutt',
+ 'password' => 'valid-password'
+);
+if (Gatekeeper::authenticate($credentials, true) == true) {
+ echo 'valid!';
+}
+?>
+```
+
+The only difference here is that second parameter, the `true`, that is a switch to turn on the "remember" handling. By default this is disabled, so if you want to use this automatically, you'll need to enable it here. With that enabled, you can then use the `checkRememberMe` method mentioned above to get the user that matches the token.