You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
429 B

5 years ago
5 years ago
5 years ago
  1. # Gear/Auth
  2. ```php
  3. // routes that are ignored by auth
  4. $routes = array(
  5. '/',
  6. );
  7. $app->register('auth', 'Gear\Middleware\AuthMiddleware', array($routes));
  8. // adding jwtHelper
  9. $options = array(
  10. env('JWT_SECRET'),
  11. env('JWT_URL'),
  12. env('JWT_EXPIRED_AT'),
  13. );
  14. $app->register('jwtHelper', 'Gear\Helpers\JwtHelper', $options);
  15. // adding filters
  16. $app->before('start', array(new Gear\Filters\AuthFilter, 'before'));
  17. ```