Difference between #3 and #4 of
JWT authentication tutorial

Revision #4 has been created by Allan Jensen on Oct 3, 2021, 5:59:50 PM with the memo:

Added parent behaviors
« previous (#3)

Changes

Title unchanged

JWT authentication tutorial

Category unchanged

Tutorials

Yii version unchanged

2.0

Tags unchanged

authentication,auth,jwt

Content changed

[...]
- Add the authenticator behavior to your controllers
- For `AuthController.php` we must exclude actions that do not require being authenticated, like `login`, `refresh-token`, `options` (when browser sends the cross-site OPTIONS request).

```php
public function behaviors() {
     $behaviors = parent::behaviors();
 
 
$behaviors['authenticator'] = [
'class' => \sizeg\jwt\JwtHttpBearerAuth::class,
'except' => [
'login',
'refresh-token',
'options',
[...]
13 0
8 followers
Viewed: 164 246 times
Version: 2.0
Category: Tutorials
Written by: Allan Jensen
Last updated by: Allan Jensen
Created on: Jun 7, 2021
Last updated: 3 years ago
Update Article

Revisions

View all history