File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change 4
4
use LionRequest \Response ;
5
5
use Carbon \Carbon ;
6
6
7
- use App \Http \Middleware \JWT \AuthorizationControlMiddleware ;
7
+ use App \Http \Middleware \JWT \AuthorizationMiddleware ;
8
8
9
9
/**
10
10
* ------------------------------------------------------------------------------
14
14
**/
15
15
16
16
Route::newMiddleware ([
17
- ['jwt-authorize ' , AuthorizationControlMiddleware::class, 'authorize ' ]
17
+ ['auth ' , AuthorizationMiddleware::class, 'authorize ' ],
18
+ ['no-auth ' , AuthorizationMiddleware::class, 'notAuthorize ' ]
18
19
]);
19
20
20
21
Route::get ('/ ' , function () {
21
22
return Response::success ('Welcome to index! ' . Carbon::now ());
22
23
});
23
24
24
25
Route::prefix ('auth ' , function () {
25
- Route::get ('signin ' , function () {
26
+ Route::post ('signin ' , function () {
26
27
return Response::success ('signin... ' );
27
- });
28
+ }, [ ' no-auth ' ] );
28
29
29
- Route::get ('signout ' , function () {
30
+ Route::post ('signout ' , function () {
30
31
return Response::success ('signout... ' );
31
- });
32
+ }, ['no-auth ' ]);
33
+
34
+ Route::get ('logout ' , function () {
35
+ return Response::success ('logout... ' );
36
+ }, ['auth ' ]);
32
37
});
You can’t perform that action at this time.
0 commit comments