File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,10 @@ class StageFrontController extends Controller
1414 */
1515 public function create ()
1616 {
17+ if (session ('stagefront.unlocked ' ) === true ) {
18+ return redirect ('/ ' );
19+ }
20+
1721 $ liveSite = config ('stagefront.live_site ' );
1822
1923 if ($ liveSite ) {
Original file line number Diff line number Diff line change @@ -84,6 +84,16 @@ public function it_does_not_allow_access_when_you_provide_invalid_credentials()
8484 ->assertSessionHasErrors ('password ' );
8585 }
8686
87+ /** @test */
88+ public function it_redirects_home_if_you_are_already_logged_in ()
89+ {
90+ $ this ->enableStageFront ();
91+
92+ session ()->put ('stagefront.unlocked ' , true );
93+
94+ $ this ->get ($ this ->url )->assertRedirect ('/ ' );
95+ }
96+
8797 /** @test */
8898 public function the_password_may_be_stored_encrypted ()
8999 {
You can’t perform that action at this time.
0 commit comments