Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/flusherdock1/jwtauth
JWTAuth plugin for October CMS
https://github.com/flusherdock1/jwtauth
cms october octobercms plugin
Last synced: 3 months ago
JSON representation
JWTAuth plugin for October CMS
- Host: GitHub
- URL: https://github.com/flusherdock1/jwtauth
- Owner: FlusherDock1
- License: mit
- Created: 2021-10-13T20:02:44.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-06-19T11:41:20.000Z (over 2 years ago)
- Last Synced: 2024-05-04T09:20:31.467Z (9 months ago)
- Topics: cms, october, octobercms, plugin
- Language: PHP
- Homepage: https://octobercms.com/plugin/reazzon-jwtauth
- Size: 61.5 KB
- Stars: 12
- Watchers: 4
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JWTAuth plugin for Lovata.Buddies and RainLab.User*
*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:
```bash
php artisan plugin:install ReaZzon.JWTAuth
```2. Generate JWT Secret:
```bash
php artisan jwt:secret
```## Middleware
To use JWT Middleware, put `ResolveUser` middleware in your routes. Example below:
```php
Route::group(['middleware' => [\ReaZzon\JWTAuth\Http\Middlewares\ResolveUser::class]], function () {// Routes only for authenticated users
});
```or
```php
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](https://github.com/FlusherDock1/JWTAuth)
---
© 2021, Nick Khaetsky and Vladimir Pyankov under the [MIT license](https://opensource.org/licenses/MIT).Russian October CMS comminuty [OctoClub](https://octoclub.ru/).