-
Notifications
You must be signed in to change notification settings - Fork 0
/
auth.php
96 lines (85 loc) · 2.51 KB
/
auth.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php
use Illuminate\Support\Facades\Route;
use A2Workspace\LaravelJwt\LaravelJwt;
use A2Workspace\SocialEntry\SocialEntry;
/*
|--------------------------------------------------------------------------
| SocialEntry Authorization Routes
|--------------------------------------------------------------------------
|
| Includes:
| - GET: /auth/socialite
| - GET: /auth/socialite/{provider}/callback
|
*/
SocialEntry::routes(function ($registrar) {
$registrar->forAuthorization();
});
/*
|--------------------------------------------------------------------------
| User Auth Routes
|--------------------------------------------------------------------------
|
| Here define the routes used for authentication / authorization client user.
|
| Includes:
| - POST: /api/auth/login
| - POST: /api/auth/logout
| - POST: /api/auth/refresh
| - GET: /api/auth/user
|
| - POST: /api/auth/socialite/token
| - POST: /api/auth/socialite/login
| - POST: /api/auth/socialite/connect
| - POST: /api/auth/socialite/disconnect
|
*/
LaravelJwt::routes([
'prefix' => '/api/auth',
'middleware' => ['api', 'assign.guard:client'],
'namespace' => '\App\Http\Controllers\Client',
'as' => 'auth.',
]);
SocialEntry::routes(function ($registrar) {
$options = [
'prefix' => '/api/auth/socialite',
'middleware' => ['api', 'assign.guard:client'],
'as' => 'auth.social-entry.',
];
$registrar->forAccessToken($options);
$registrar->forUserAccesses($options);
});
/*
|--------------------------------------------------------------------------
| Admin Auth Routes
|--------------------------------------------------------------------------
|
| Here define the routes used for authentication / authorization admin user.
|
| Includes:
| - POST: /admin/api/auth/login
| - POST: /admin/api/auth/logout
| - POST: /admin/api/auth/refresh
| - GET: /admin/api/auth/user
|
| - POST: /admin/api/auth/socialite/token
| - POST: /admin/api/auth/socialite/login
| - POST: /admin/api/auth/socialite/connect
| - POST: /admin/api/auth/socialite/disconnect
|
*/
LaravelJwt::routes([
'prefix' => '/admin/api/auth',
'middleware' => ['api', 'assign.guard:admin'],
'namespace' => '\App\Http\Controllers\Admin',
'as' => 'admin.auth.',
]);
SocialEntry::routes(function ($registrar) {
$options = [
'prefix' => '/admin/api/auth/socialite',
'middleware' => ['api', 'assign.guard:admin'],
'as' => 'admin.auth.social-entry.',
];
$registrar->forAccessToken($options);
$registrar->forUserAccesses($options);
});