From 19a05a1a5bb1e5416998adc974b826ea4542bf4f Mon Sep 17 00:00:00 2001 From: kushal-saha Date: Mon, 27 Apr 2026 05:39:09 +0000 Subject: [PATCH] feature: authentication using fortify and sanctum's cookie based SPA authentication --- .idea/neoban.iml | 6 +- .idea/php.xml | 14 +- backend/.env.example | 3 +- backend/app/Actions/Fortify/CreateNewUser.php | 43 +++ .../Fortify/PasswordValidationRules.php | 19 + .../app/Actions/Fortify/ResetUserPassword.php | 32 ++ .../Actions/Fortify/UpdateUserPassword.php | 35 ++ .../Fortify/UpdateUserProfileInformation.php | 61 +++ .../Controllers/SocialMediaPostController.php | 3 + backend/app/Models/User.php | 2 +- backend/app/Providers/AppServiceProvider.php | 28 +- .../app/Providers/FortifyServiceProvider.php | 48 +++ backend/bootstrap/app.php | 11 +- backend/bootstrap/providers.php | 2 + backend/composer.json | 2 +- backend/composer.lock | 359 ++++++++++++++---- backend/config/cors.php | 34 ++ backend/config/fortify.php | 159 ++++++++ backend/config/sanctum.php | 9 +- ..._add_two_factor_columns_to_users_table.php | 42 ++ backend/routes/api.php | 2 +- frontend/src/app/app.routes.ts | 4 + 22 files changed, 837 insertions(+), 81 deletions(-) create mode 100644 backend/app/Actions/Fortify/CreateNewUser.php create mode 100644 backend/app/Actions/Fortify/PasswordValidationRules.php create mode 100644 backend/app/Actions/Fortify/ResetUserPassword.php create mode 100644 backend/app/Actions/Fortify/UpdateUserPassword.php create mode 100644 backend/app/Actions/Fortify/UpdateUserProfileInformation.php create mode 100644 backend/app/Providers/FortifyServiceProvider.php create mode 100644 backend/config/cors.php create mode 100644 backend/config/fortify.php create mode 100644 backend/database/migrations/2026_04_24_120752_add_two_factor_columns_to_users_table.php diff --git a/.idea/neoban.iml b/.idea/neoban.iml index a0063c6..cdb1fe4 100644 --- a/.idea/neoban.iml +++ b/.idea/neoban.iml @@ -34,7 +34,6 @@ - @@ -139,6 +138,11 @@ + + + + + diff --git a/.idea/php.xml b/.idea/php.xml index 480cdc8..4bfd474 100644 --- a/.idea/php.xml +++ b/.idea/php.xml @@ -1,5 +1,10 @@ + + + + + @@ -10,6 +15,9 @@