From 3c6280111e4c76c1017a390169759d2612c60f4a Mon Sep 17 00:00:00 2001 From: Shlee Date: Thu, 27 Aug 2026 18:37:04 +0930 Subject: [PATCH] Update AccountController.php --- app/Http/Controllers/AccountController.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index b564f7d42..a04e46f62 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -63,7 +63,7 @@ class AccountController extends Controller $allowed = ['like', 'follow']; $timeago = Carbon::now()->subMonths(3); - $profile = Auth::user()->profile; + $profile = $request->user()->profile; $following = $profile->following->pluck('id'); $notifications = Notification::whereIn('actor_id', $following) @@ -388,7 +388,7 @@ class AccountController extends Controller public function followRequests(Request $request) { - $pid = Auth::user()->profile->id; + $pid = $request->user()->profile->id; $followers = FollowRequest::whereFollowingId($pid)->orderBy('id', 'desc')->whereIsRejected(0)->simplePaginate(10); return view('account.follow-requests', compact('followers')); @@ -396,7 +396,7 @@ class AccountController extends Controller public function followRequestsJson(Request $request) { - $pid = Auth::user()->profile_id; + $pid = $request->user()->profile_id; $followers = FollowRequest::whereFollowingId($pid)->orderBy('id', 'desc')->whereIsRejected(0)->get(); $res = [ 'count' => $followers->count(), @@ -425,7 +425,7 @@ class AccountController extends Controller 'id' => 'required|integer|min:1', ]); - $pid = Auth::user()->profile->id; + $pid = $request->user()->profile->id; $action = $request->input('action') === 'accept' ? 'accept' : 'reject'; $id = $request->input('id'); $followRequest = FollowRequest::whereFollowingId($pid)->findOrFail($id); @@ -504,7 +504,7 @@ class AccountController extends Controller $this->validate($request, [ 'code' => 'required|string|max:32', ]); - $user = Auth::user(); + $user = $request->user(); $code = $request->input('code'); $google2fa = new Google2FA; $verify = $google2fa->verifyKey($user->{'2fa_secret'}, $code);