Skip to content
This repository was archived by the owner on Apr 19, 2025. It is now read-only.

Commit 847c956

Browse files
committed
Make routes configurable
1 parent dcc5345 commit 847c956

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

src/config/twofactor-auth.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,24 @@
4444
'driver' => 'null',
4545
],
4646

47-
]
47+
],
48+
49+
/*
50+
|--------------------------------------------------------------------------
51+
| Routes Configuration + Naming
52+
|--------------------------------------------------------------------------
53+
|
54+
| Here you may customize the route URL's and in case of the GET route, also
55+
| the route name.
56+
|
57+
*/
58+
59+
'routes' => [
60+
'get' => [
61+
'url' => '/auth/token',
62+
'name' => 'auth.token',
63+
],
64+
'post' => '/auth/token',
65+
],
4866

4967
];

src/routes.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
'middleware' => ['web', 'guest'],
77
'namespace' => 'App\Http\Controllers\Auth',
88
], function () use ($router) {
9-
$router->get('/auth/token', 'TwoFactorAuthController@showTwoFactorForm')->name('auth.token');
10-
$router->post('/auth/token', 'TwoFactorAuthController@verifyToken');
9+
$router->get(
10+
config('twofactor-auth.routes.get.url'),
11+
'TwoFactorAuthController@showTwoFactorForm'
12+
)->name(config('twofactor-auth.routes.get.name'));
13+
$router->post(config('twofactor-auth.routes.post'), 'TwoFactorAuthController@verifyToken');
1114
});

0 commit comments

Comments
 (0)