{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","params":[],"results":{"codes":[]},"settings":""},"next":{"description":"","pages":[]},"title":"Auth","type":"basic","slug":"auth","excerpt":"","body":"# Auth\n\nThis provider helps us to have an access to this class ``Clarity\\Support\\Auth\\Auth``\n\nThe sample module ``main`` uses some of the defined functions, such as:\n```php\n<?php\n\n$auth = di()->get('auth');\n\n\n# to loging the user, provide the fields needed, along the password field\n$auth->attempt([\n    'email' => 'john.doe:::at:::example.com',\n    'password' => '123qwe',\n]);\n\n\n# to determine if the current sesssion has some\n# logged-in record\nif ($auth->check()) {\n    // ...\n}\n\n\n# to redirect the user if a key given in the url\nreturn $auth->redirectIntended();\n\n\n# to get the current user information\n$auth->user();\n\n\n# to destroy the current logged-in record\n$auth->destroy();\n```\n\nThis provider determines your config ``project-name/config/app.php`` under ``auth`` key","updates":[],"order":1,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"56e26ee58d79b50e0031d8fc","user":"56c1105874f0b417004baadc","project":"56c111095abfe40d00be875a","category":{"sync":{"isSync":false,"url":""},"pages":["56e26e99e2ee8a0e00f3ef89","56e26ee58d79b50e0031d8fc","56e26ef15ab0871700957c08","56e26ef8353e060e00b9682b","56e26f0c5ab0871700957c0a","56e26f1e5ab0871700957c0c","56e26f307d54ba0e004635a5","56e26f3a8d79b50e0031d8fe","56e26f43353e060e00b96831","56e26f4ae2ee8a0e00f3ef8d","56e26f508d79b50e0031d900","56e26f5a7d54ba0e004635a7","56e26f608d79b50e0031d902","56e26f67e2ee8a0e00f3ef8f","56e26f6f95d1c60e00a969e2","56e26f7695d1c60e00a969e4","56e26f7f8d79b50e0031d904","56e26f86353e060e00b96833","56e26f937d54ba0e004635aa"],"title":"Services","slug":"services","order":4,"from_sync":false,"reference":false,"_id":"56c4282cbc41330d009f2607","__v":19,"project":"56c111095abfe40d00be875a","createdAt":"2016-02-17T07:58:36.312Z","version":"56c111095abfe40d00be875d"},"githubsync":"","parentDoc":null,"__v":2,"createdAt":"2016-03-11T07:08:21.909Z","version":{"version":"1.3.0","version_clean":"1.3.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["56c1110a5abfe40d00be875e","56c413a254b6030d00ec299d","56c4275048213b1700af6e33","56c42826c0c4630d004e86cb","56c4282cbc41330d009f2607","56c4284ad1f6d91700d3697e","56e271c195d1c60e00a969ee"],"_id":"56c111095abfe40d00be875d","releaseDate":"2016-02-14T23:43:05.566Z","__v":7,"createdAt":"2016-02-14T23:43:05.566Z","project":"56c111095abfe40d00be875a"}}
# Auth This provider helps us to have an access to this class ``Clarity\Support\Auth\Auth`` The sample module ``main`` uses some of the defined functions, such as: ```php <?php $auth = di()->get('auth'); # to loging the user, provide the fields needed, along the password field $auth->attempt([ 'email' => '[email protected]', 'password' => '123qwe', ]); # to determine if the current sesssion has some # logged-in record if ($auth->check()) { // ... } # to redirect the user if a key given in the url return $auth->redirectIntended(); # to get the current user information $auth->user(); # to destroy the current logged-in record $auth->destroy(); ``` This provider determines your config ``project-name/config/app.php`` under ``auth`` key