Skip to content

Commit 019dc86

Browse files
login
1 parent 0b2cd62 commit 019dc86

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
},
3939
"scripts": {
4040
"lint":"",
41-
"serve-dev":"ENVIRONMENT=development php -S \"${HOST:-localhost}:${PORT:-8080}\" -t web/ web/index.php",
41+
"serve-dev":"USER=alice PASSWORD=alice123 ENVIRONMENT=development php -S \"${HOST:-localhost}:${PORT:-8080}\" -t web/ web/index.php",
4242
"serve-dev-docker":"bash ./bin/serve-docker-dev.sh",
4343
"test":"phpunit"
4444
},

web/index.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use League\Route\Http\Exception\NotFoundException;
1717
use League\Route\Router;
1818
use League\Route\Strategy\ApplicationStrategy;
19+
use Pdsinterop\Solid\Controller\LoginController;
1920
use Pdsinterop\Solid\Controller\AddSlashToPathController;
2021
use Pdsinterop\Solid\Controller\HelloWorldController;
2122
use Pdsinterop\Solid\Controller\HttpToHttpsController;
@@ -34,6 +35,7 @@
3435
);
3536
$strategy = new ApplicationStrategy();
3637

38+
session_start();
3739
$router = new Router();
3840

3941
/*/ Wire objects together /*/
@@ -70,6 +72,7 @@
7072
});
7173

7274
$controllers = [
75+
LoginController::class,
7376
AddSlashToPathController::class,
7477
CardController::class,
7578
HelloWorldController::class,
@@ -114,6 +117,7 @@
114117
$router->map('GET', '/', HelloWorldController::class)->setScheme($scheme);
115118

116119
/*/ Create URI groups /*/
120+
$router->map('POST', '/login', LoginController::class)->setScheme($scheme);
117121
$router->map('GET', '/profile', AddSlashToPathController::class)->setScheme($scheme);
118122
$router->map('GET', '/profile/', ProfileController::class)->setScheme($scheme);
119123
$router->map('GET', '/profile/card', CardController::class)->setScheme($scheme);

0 commit comments

Comments
 (0)