File tree Expand file tree Collapse file tree 7 files changed +12
-44
lines changed
Expand file tree Collapse file tree 7 files changed +12
-44
lines changed Original file line number Diff line number Diff line change @@ -10,15 +10,13 @@ trait RedirectsUsers
1010{
1111 /**
1212 * Get the post register / login redirect path.
13- *
14- * @return string
1513 */
16- public function redirectPath ()
14+ public function redirectPath (): string
1715 {
1816 if (method_exists ($ this , 'redirectTo ' )) {
1917 return $ this ->redirectTo ();
2018 }
2119
22- return property_exists ($ this , 'redirectTo ' ) ? $ this ->redirectTo : '/home ' ;
20+ return property_exists ($ this , 'redirectTo ' ) ? $ this ->redirectTo : '/ ' ;
2321 }
2422}
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ namespace App\Http\Controllers\Identities\Auth;
44
55use App\User;
66use App\Http\Controllers\Controller;
7- use App\Providers\RouteServiceProvider;
87use Oneofftech\Identities\Auth\ConnectUserIdentity;
98
109class ConnectController extends Controller
@@ -25,18 +24,9 @@ class ConnectController extends Controller
2524
2625 /**
2726 * Where to redirect users after connection.
28- *
29- * @var string
3027 */
31- protected $redirectTo = RouteServiceProvider::HOME;
32-
33- /**
34- * Create a new controller instance.
35- *
36- * @return void
37- */
38- public function __construct()
28+ protected function redirectTo(): string
3929 {
40- $this->middleware('auth') ;
30+ return '/' ;
4131 }
4232}
Original file line number Diff line number Diff line change 33namespace App\Http\Controllers\Identities\Auth;
44
55use App\Http\Controllers\Controller;
6- use App\Providers\RouteServiceProvider;
76use Oneofftech\Identities\Auth\AuthenticatesUsersWithIdentity;
87
98class LoginController extends Controller
@@ -24,18 +23,9 @@ class LoginController extends Controller
2423
2524 /**
2625 * Where to redirect users after login.
27- *
28- * @var string
2926 */
30- protected $redirectTo = RouteServiceProvider::HOME;
31-
32- /**
33- * Create a new controller instance.
34- *
35- * @return void
36- */
37- public function __construct()
27+ protected function redirectTo(): string
3828 {
39- $this->middleware('guest') ;
29+ return '/' ;
4030 }
4131}
Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ use App\User;
66use Illuminate\Support\Str;
77use App\Http\Controllers\Controller;
88use Illuminate\Support\Facades\Hash;
9- use App\Providers\RouteServiceProvider;
109use Illuminate\Support\Facades\Validator;
1110use Oneofftech\Identities\Auth\RegistersUsersWithIdentity;
1211
@@ -27,19 +26,10 @@ class RegisterController extends Controller
2726
2827 /**
2928 * Where to redirect users after registration.
30- *
31- * @var string
32- */
33- protected $redirectTo = RouteServiceProvider::HOME;
34-
35- /**
36- * Create a new controller instance.
37- *
38- * @return void
3929 */
40- public function __construct()
30+ protected function redirectTo(): string
4131 {
42- $this->middleware('guest') ;
32+ return '/' ;
4333 }
4434
4535 /**
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ public function test_connect_creates_identity()
9393 $ response = $ this ->actingAs ($ user )
9494 ->get (route ('oneofftech::connect.callback ' , ['provider ' => 'gitlab ' ]));
9595
96- $ response ->assertRedirect ('http://localhost/home ' );
96+ $ response ->assertRedirect ('http://localhost ' );
9797
9898 $ updatedIdentity = $ user ->identities ->first ();
9999
@@ -144,7 +144,7 @@ public function test_connect_updates_existing_identity()
144144 $ response = $ this ->actingAs ($ user )
145145 ->get (route ('oneofftech::connect.callback ' , ['provider ' => 'gitlab ' ]));
146146
147- $ response ->assertRedirect ('http://localhost/home ' );
147+ $ response ->assertRedirect ('http://localhost ' );
148148
149149 $ updatedIdentity = $ user ->identities ->first ();
150150
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ public function test_user_login()
6767
6868 $ response = $ this ->get (route ('oneofftech::login.callback ' , ['provider ' => 'gitlab ' ]));
6969
70- $ response ->assertRedirect ('http://localhost/home ' );
70+ $ response ->assertRedirect ('http://localhost ' );
7171
7272 $ this ->assertAuthenticatedAs ($ user );
7373 }
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ public function test_user_can_be_registered()
5656
5757 $ response = $ this ->get (route ('oneofftech::register.callback ' , ['provider ' => 'gitlab ' ]));
5858
59- $ response ->assertRedirect ('http://localhost/home ' );
59+ $ response ->assertRedirect ('http://localhost ' );
6060
6161 $ user = User::first ();
6262
You can’t perform that action at this time.
0 commit comments