Update AccountController.php

pull/6865/head
Shlee 4 weeks ago committed by GitHub
parent 8778273c7c
commit 3c6280111e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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);

Loading…
Cancel
Save