Cachet/app/Http/Routes/AuthRoutes.php

74 lines
1.9 KiB
PHP
Raw Normal View History

2015-03-20 18:30:45 -06:00
<?php
/*
* This file is part of Cachet.
*
2015-07-06 17:37:01 +01:00
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
2015-03-20 18:30:45 -06:00
namespace CachetHQ\Cachet\Http\Routes;
use Illuminate\Contracts\Routing\Registrar;
/**
* This is the auth routes class.
*
* @author James Brooks <james@alt-three.com>
*/
2015-03-20 18:30:45 -06:00
class AuthRoutes
{
2016-10-19 12:28:54 +01:00
/**
* Defines if these routes are for the browser.
*
* @var bool
*/
public static $browser = true;
2015-03-20 18:30:45 -06:00
/**
* Define the auth routes.
*
* @param \Illuminate\Contracts\Routing\Registrar $router
2015-12-24 17:30:59 +00:00
*
* @return void
2015-03-20 18:30:45 -06:00
*/
public function map(Registrar $router)
{
2016-10-12 21:31:07 +01:00
$router->group([
2016-10-19 12:28:54 +01:00
'middleware' => ['ready'],
2016-10-12 21:31:07 +01:00
'prefix' => 'auth',
], function (Registrar $router) {
$router->get('login', [
2016-10-12 21:31:07 +01:00
'as' => 'get:auth.login',
'middleware' => 'guest',
'uses' => 'AuthController@showLogin',
]);
$router->post('login', [
2016-10-12 21:31:07 +01:00
'as' => 'post:auth.login',
2016-02-25 21:26:46 +00:00
'middleware' => ['guest', 'throttle:10,10'],
'uses' => 'AuthController@postLogin',
]);
$router->get('2fa', [
2016-10-12 21:31:07 +01:00
'as' => 'get:auth.two-factor',
'uses' => 'AuthController@showTwoFactorAuth',
]);
$router->post('2fa', [
2016-10-12 21:31:07 +01:00
'as' => 'post:auth.two-factor',
2016-02-25 21:26:46 +00:00
'middleware' => ['throttle:10,10'],
'uses' => 'AuthController@postTwoFactor',
]);
$router->get('logout', [
2016-10-12 21:31:07 +01:00
'as' => 'get:auth.logout',
'uses' => 'AuthController@logoutAction',
'middleware' => 'auth',
]);
2015-03-20 18:30:45 -06:00
});
}
}