delete backend, starting over
This commit is contained in:
parent
babf9eb855
commit
f6a33cf620
51 changed files with 0 additions and 6655 deletions
|
|
@ -1,44 +0,0 @@
|
|||
<?php
|
||||
|
||||
use App\Auth\BcryptPasswordHasher;
|
||||
use App\Auth\Clock;
|
||||
use App\Auth\PasswordHasher;
|
||||
use App\Auth\PostgresSessionRepository;
|
||||
use App\Auth\RandomTokenGenerator;
|
||||
use App\Auth\SessionRepository;
|
||||
use App\Auth\SystemClock;
|
||||
use App\Auth\TokenGenerator;
|
||||
use App\Auth\UseCases\AuthenticateUser\AuthenticateUser;
|
||||
use App\Auth\UseCases\CreateSession\CreateSession;
|
||||
use App\Auth\UseCases\Logout\Logout;
|
||||
use App\Controllers\AuthController;
|
||||
use App\Middleware\AuthMiddleware;
|
||||
use App\User\PostgresUserRepository;
|
||||
use App\User\UserRepository;
|
||||
use DI\ContainerBuilder;
|
||||
|
||||
$builder = new ContainerBuilder();
|
||||
|
||||
$builder->addDefinitions([
|
||||
|
||||
// Services
|
||||
PasswordHasher::class => DI\create(BcryptPasswordHasher::class),
|
||||
TokenGenerator::class => DI\create(RandomTokenGenerator::class),
|
||||
Clock::class => DI\create(SystemClock::class),
|
||||
|
||||
// Repositories
|
||||
UserRepository::class => DI\create(PostgresUserRepository::class),
|
||||
SessionRepository::class => DI\create(PostgresSessionRepository::class),
|
||||
|
||||
// Use cases
|
||||
AuthenticateUser::class => DI\autowire(),
|
||||
CreateSession::class => DI\autowire(),
|
||||
Logout::class => DI\autowire(),
|
||||
|
||||
// HTTP layer
|
||||
AuthController::class => DI\autowire(),
|
||||
AuthMiddleware::class => DI\autowire(),
|
||||
|
||||
]);
|
||||
|
||||
return $builder->build();
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Capsule\Manager as Capsule;
|
||||
|
||||
$capsule = new Capsule();
|
||||
|
||||
$capsule->addConnection([
|
||||
'driver' => 'pgsql',
|
||||
'host' => $_ENV['DB_HOST'],
|
||||
'port' => $_ENV['DB_PORT'],
|
||||
'database' => $_ENV['DB_NAME'],
|
||||
'username' => $_ENV['DB_USER'],
|
||||
'password' => $_ENV['DB_PASSWORD'],
|
||||
'charset' => 'utf8',
|
||||
]);
|
||||
|
||||
$capsule->setAsGlobal();
|
||||
$capsule->bootEloquent();
|
||||
|
||||
return $capsule;
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
<?php
|
||||
|
||||
use App\Controllers\AuthController;
|
||||
use App\Middleware\AuthMiddleware;
|
||||
use App\Middleware\CorsMiddleware;
|
||||
use Slim\App;
|
||||
use Slim\Routing\RouteCollectorProxy;
|
||||
|
||||
return function (App $app): void {
|
||||
|
||||
$app->add(CorsMiddleware::class);
|
||||
|
||||
$app->get('/me', [AuthController::class, 'me'])
|
||||
->add(AuthMiddleware::class);
|
||||
|
||||
$app->post('/login', [AuthController::class, 'login']);
|
||||
|
||||
$app->post('/logout', [AuthController::class, 'logout'])
|
||||
->add(AuthMiddleware::class);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue