Skip to content

Commit 33ec56d

Browse files
committed
Fix flash messages and add middleware
1 parent 0f79785 commit 33ec56d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

app/Http/Controllers/Auth/AuthController.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ public function __construct(
5656
$this->confirmation = $confirmation;
5757

5858
$this->middleware('guest', ['except' => ['logout', 'confirmEmail', 'resendEmailConfirmation']]);
59+
$this->middleware('auth', ['only' => ['logout', 'resendEmailConfirmation']]);
5960
}
6061

6162
/**
@@ -146,7 +147,9 @@ public function confirmEmail($code)
146147

147148
Auth::login($user, true);
148149

149-
return redirect()->home()->with('success', 'Your email was successfully confirmed.');
150+
session(['success' => 'Your email was successfully confirmed.']);
151+
152+
return redirect()->home();
150153
}
151154

152155
/**
@@ -158,7 +161,9 @@ public function resendEmailConfirmation()
158161
{
159162
$this->confirmation->send(Auth::user());
160163

161-
return redirect()->home()->with('success', 'A new email confirmation was sent to ' . Auth::user()->email);
164+
session(['success' => 'A new email confirmation was sent to ' . Auth::user()->email]);
165+
166+
return redirect()->home();
162167
}
163168

164169
/**

0 commit comments

Comments
 (0)