File tree 2 files changed +35
-0
lines changed
2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change 53
53
* Route configuration
54
54
*/
55
55
'route_configuration ' => [
56
+ /**
57
+ * Enable or disable the login route.
58
+ */
59
+ 'enabled ' => env ('OIDC_LOGIN_ROUTE_ENABLED ' , true ),
60
+
61
+ /**
62
+ * The url of the login route.
63
+ */
56
64
'login_route ' => env ('OIDC_LOGIN_ROUTE ' , '/oidc/login ' ),
65
+
66
+ /**
67
+ * The middleware that runs on the login route.
68
+ */
57
69
'middleware ' => [
58
70
'web '
59
71
],
72
+
73
+ /**
74
+ * The prefix of the login route.
75
+ */
60
76
'prefix ' => '' ,
61
77
]
62
78
];
Original file line number Diff line number Diff line change @@ -42,6 +42,10 @@ public function boot(): void
42
42
43
43
protected function registerRoutes (): void
44
44
{
45
+ if (!$ this ->routesEnabled ()) {
46
+ return ;
47
+ }
48
+
45
49
Route::group ($ this ->routeConfiguration (), function () {
46
50
$ this ->loadRoutesFrom (__DIR__ . '/../routes/oidc.php ' );
47
51
});
@@ -60,6 +64,21 @@ protected function routeConfiguration(): array
60
64
];
61
65
}
62
66
67
+ /**
68
+ * Check in config if the routes are enabled.
69
+ *
70
+ * @return bool
71
+ */
72
+ protected function routesEnabled (): bool
73
+ {
74
+ $ enabled = config ('oidc.route_configuration.enabled ' );
75
+ if (!is_bool ($ enabled )) {
76
+ return false ;
77
+ }
78
+
79
+ return $ enabled ;
80
+ }
81
+
63
82
protected function registerConfigurationLoader (): void
64
83
{
65
84
$ this ->app ->singleton (OpenIDConfigurationLoader::class, function (Application $ app ) {
You can’t perform that action at this time.
0 commit comments