From fa4f4f144169011b5003d4906522318940a09bf9 Mon Sep 17 00:00:00 2001 From: Julian Prieber <60265788+JulianPrieber@users.noreply.github.com> Date: Sat, 19 Mar 2022 16:48:21 +0100 Subject: [PATCH] Added email verification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added email verification after user registration. After a user registered, an email is sent to the email used to sign up. The mail contains a verification link which is required to complete the registration process. This feature can be turned off in the Admin Panel under: Admin>Config by changing the setting "Register_auth" from "verified" to "auth". Read more about this on the Blog here: https://blog.littlelink-custom.com/optional-email-verification/ --- .env | 4 ++++ app/Models/User.php | 2 +- resources/views/auth/verify-email.blade.php | 2 +- routes/web.php | 2 +- storage/backups/default_settings | 9 ++++++--- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.env b/.env index 719943f..ea17cab 100644 --- a/.env +++ b/.env @@ -1,3 +1,7 @@ +#Email verification=Changes if users have to verify their email after registration. +#=Register_auth either auth or verified. If auth is selected, no verification is required. Default is verified. +Register_auth=verified + #App Settings=Changes settings regarding your LittleLink Custom installation. You probably only want to change the App Name setting. #=App_Name changes the displayed name for the App in the title, for example. App_Name="LittleLink Custom" diff --git a/app/Models/User.php b/app/Models/User.php index 804799b..a481d17 100755 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -7,7 +7,7 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; -class User extends Authenticatable +class User extends Authenticatable implements MustVerifyEmail { use HasFactory, Notifiable; diff --git a/resources/views/auth/verify-email.blade.php b/resources/views/auth/verify-email.blade.php index dbb42cb..fb88135 100755 --- a/resources/views/auth/verify-email.blade.php +++ b/resources/views/auth/verify-email.blade.php @@ -7,7 +7,7 @@
- {{ __('Thanks for signing up! Before getting started, could you verify your email address by clicking on the link we just emailed to you? If you didn\'t receive the email, we will gladly send you another.') }} + {{ __('Thanks for signing up! Before getting started, could you verify your email address by clicking on the link we just emailed to you? If you didn\'t receive the email, we will gladly send you another. If you do not see the email in a few minutes, check your junk mail or spam folder.') }}
@if (session('status') == 'verification-link-sent') diff --git a/routes/web.php b/routes/web.php index 177cdb4..e6f402c 100755 --- a/routes/web.php +++ b/routes/web.php @@ -26,7 +26,7 @@ Route::get('/', [App\Http\Controllers\HomeController::class, 'home'])->name('hom //User route Route::group([ - 'middleware' => 'auth', + 'middleware' => env('REGISTER_AUTH'), ], function () { URL::forceScheme('https'); # comment to disable https Route::get('/studio/index', [UserController::class, 'index'])->name('studioIndex'); diff --git a/storage/backups/default_settings b/storage/backups/default_settings index 94de80c..8747c5f 100644 --- a/storage/backups/default_settings +++ b/storage/backups/default_settings @@ -1,8 +1,11 @@ +#Email verification=Changes if users have to verify their email after registration. +#=Register_auth either auth or verified. If auth is selected, no verification is required. Default is verified. +Register_auth=verified + #App Settings=Changes settings regarding your LittleLink Custom installation. You probably only want to change the App Name setting. #=App_Name changes the displayed name for the App in the title, for example. App_Name="LittleLink Custom" -# You can get a new App Key from https://littlelink-custom.com/key.php -App_Key=base64:YOU+MUST+CHANGE+THIS+YUFukELiN6Bk9gQ19+9zwk= +APP_KEY=base64:YOU+MUST+CHANGE+THIS+YUFukELiN6Bk9gQ19+9zwk= App_URL= @@ -43,4 +46,4 @@ Broadcast_driver=log Cache_driver=file Queue_connection=sync Session_driver=file -Session_lifetime=120 \ No newline at end of file +Session_lifetime=120