From 37302ee559ceb7e73dbf2c18bc22bacef132e24e Mon Sep 17 00:00:00 2001 From: Eduard Lupacescu Date: Sun, 31 Aug 2025 14:13:52 +0300 Subject: [PATCH] fix: adding loggout and docs support, improved email verification --- config/restify.php | 32 ++ docs-v3/components/SearchModal.vue | 42 ++- docs-v3/components/TheSidebar.vue | 10 +- docs-v3/content/auth/authentication.md | 279 +++++++++++++++++- docs-v3/content/quickstart.md | 29 +- docs-v3/pages/[...slug].vue | 4 - src/Commands/PublishAuthCommand.php | 4 +- src/Commands/SetupCommand.php | 151 ++++++++++ src/Commands/stubs/Auth/VerifyController.stub | 49 ++- src/Http/Controllers/Auth/LoginController.php | 8 +- .../Controllers/Auth/LogoutController.php | 25 ++ .../Controllers/Auth/RegisterController.php | 22 +- .../Controllers/Auth/VerifyController.php | 46 ++- src/Notifications/VerifyEmail.php | 17 +- src/RestifyApplicationServiceProvider.php | 9 +- 15 files changed, 688 insertions(+), 39 deletions(-) create mode 100644 src/Http/Controllers/Auth/LogoutController.php diff --git a/config/restify.php b/config/restify.php index 139f981fd..0611d2d76 100644 --- a/config/restify.php +++ b/config/restify.php @@ -45,9 +45,41 @@ 'password_reset_url' => env('FRONTEND_APP_URL').'/password/reset?token={token}&email={email}', + /* + |-------------------------------------------------------------------------- + | User Email Verification URL + |-------------------------------------------------------------------------- + | + | This URL is used to redirect users after they click the email verification + | link. The API will validate the verification and redirect to this frontend + | URL with success/failure query parameters. + | + | Available placeholders: + | {id} - User ID + | {emailHash} - SHA1 hash of user's email + | + | Query parameters added by API: + | ?success=true&message=Email verified successfully. + | ?success=false&message=Invalid or expired verification link. + | + */ 'user_verify_url' => env('FRONTEND_APP_URL').'/verify/{id}/{emailHash}', 'user_model' => "\App\Models\User", + + /* + |-------------------------------------------------------------------------- + | Token TTL (Time To Live) + |-------------------------------------------------------------------------- + | + | This value determines the number of minutes that authentication tokens + | will be considered valid. After this time expires, users will need to + | re-authenticate. Set to null for tokens that never expire. + | + | Default: null (never expires) + | + */ + 'token_ttl' => env('RESTIFY_TOKEN_TTL', null), ], /* diff --git a/docs-v3/components/SearchModal.vue b/docs-v3/components/SearchModal.vue index 7cee8267f..63c7565f3 100644 --- a/docs-v3/components/SearchModal.vue +++ b/docs-v3/components/SearchModal.vue @@ -38,9 +38,14 @@ placeholder="Search documentation..." class="flex-1 bg-transparent text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 border-0 focus:ring-0 focus:outline-none text-lg" @input="performSearch" + @keyup="performSearch" @keydown.down.prevent="navigateResults('down')" @keydown.up.prevent="navigateResults('up')" @keydown.enter.prevent="selectResult" + autocomplete="off" + autocorrect="off" + autocapitalize="off" + spellcheck="false" />