Allow unverified users to log in
MODIFY
app/Http/Controllers/LoginController.php
app/Http/Controllers/LoginController.php
@@ -13,8 +13,7 @@ class LoginController extends Controller {
public function store(Request $request) {
if (Auth::attempt([
'email' => $request->input('email'),
- 'password' => $request->input('password'),
- 'verification_token' => null
+ 'password' => $request->input('password')
])) {
$user = Auth::user();

MODIFY
app/Http/Controllers/RegisterController.php
app/Http/Controllers/RegisterController.php
@@ -10,6 +10,7 @@ use App\Currency;
use App\User;
use App\Space;
use Hash;
+use Illuminate\Support\Facades\Auth;
use Mail;
class RegisterController extends Controller {
@@ -53,11 +54,9 @@ class RegisterController extends Controller {
Mail::to($user->email)->queue(new VerifyRegistration($user));
+ Auth::loginUsingId($user->id);
+
return redirect()
- ->route('login')
- ->with([
- 'alert_type' => 'success',
- 'alert_message' => 'You\'ve succesfully registered, check your e-mail to verify'
- ]);
+ ->route('dashboard');
}
}

MODIFY
resources/views/layout.blade.php
resources/views/layout.blade.php
</div>
</div>
@endif
+ @if (Auth::check() && Auth::user()->verification_token)
+ <div class="text-center" style="
+ padding: 15px;
+ color: #FFF;
+ background: #F86380;
+ ">You still need to verify your account&mdash;please check your e-mail</div>
+ @endif
@yield('body')
@if (auth()->check())
<div class="text-center mb-3">

Allow unverified users to log in