reazzon/jwtauth-plugin

There is no license information available for the latest version (2.0) of this package.

No description provided yet...

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Stars: 12

Watchers: 4

Forks: 4

Open Issues: 1

Type:october-plugin

2.0 2022-05-24 20:15 UTC

This package is auto-updated.

Last update: 2024-04-15 10:58:22 UTC


README

*RainLab.User support will be added soon.

This plugin adds to your application functionality to authenticate with JWT tokens easily, no additional settings or code required.

Requirements

  • PHP 7.4 and higher
  • October CMS v2 and higher

Installation

  1. Install plugin via terminal in your enviroment:
php artisan plugin:install ReaZzon.JWTAuth
  1. Generate JWT Secret:
php artisan jwt:secret

Middleware

To use JWT Middleware, put ResolveUser middleware in your routes. Example below:

Route::group(['middleware' => [\ReaZzon\JWTAuth\Http\Middlewares\ResolveUser::class]], function () {

  // Routes only for authenticated users
  
});

or

Route::get('account', function () {

   // Logic that should be available only for authenticated users
   
})->middleware(\ReaZzon\JWTAuth\Http\Middlewares\ResolveUser::class);

Routes

  • POST /jwt/login - Login route
  • POST /jwt/register - Registration route
  • POST /jwt/activate - Activation route (if activation set to mail)
  • POST /jwt/refresh - Refresh route

Suggestions, Ideas, Issues, Bugs

We are open to your suggestions and ideas in public repository of this plugin GitHub

© 2021, Nick Khaetsky and Vladimir Pyankov under the MIT license.

Russian October CMS comminuty OctoClub.