OAUTH SUPPORT

This commit is contained in:
Enoch
2024-08-10 00:43:52 +08:00
parent d78b38e80f
commit 357735ee22
146 changed files with 41282 additions and 18 deletions
+6 -1
View File
@@ -12,4 +12,9 @@
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
return [];
return [
'' => [
// ... 这里省略其它中间件
app\middleware\Listen::class,
]
];
+14
View File
@@ -21,3 +21,17 @@ Route::group('/auth/lay', function () {
Route::any('/{appid}/{gateway}/callback',[app\controller\LayAuth::class, 'callback']);
Route::any('/{appid}/check',[app\controller\LayAuth::class, 'check']);
});
Route::any('/.well-known/openid-configuration',[app\controller\OAuth::class, 'configfile']);
Route::group('/auth/oauth', function () {
Route::any('/authorize',[app\controller\OAuth::class, 'authorize']);
Route::any('/token',[app\controller\OAuth::class, 'token']);
Route::any('/userinfo',[app\controller\OAuth::class, 'userinfo']);
});
Route::fallback(function( $request){
print_r($request);
return json(['code' => 404, 'msg' => '404 not found']);
});