From 32496950661982aa3e56b41da7f34c4ebab9a908 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sun, 29 Oct 2023 04:50:20 -0600 Subject: [PATCH] Update ApiV1Dot1Controller, update iar redirect url format --- app/Http/Controllers/Api/ApiV1Dot1Controller.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Api/ApiV1Dot1Controller.php b/app/Http/Controllers/Api/ApiV1Dot1Controller.php index 9fdf927c..3eaa1d23 100644 --- a/app/Http/Controllers/Api/ApiV1Dot1Controller.php +++ b/app/Http/Controllers/Api/ApiV1Dot1Controller.php @@ -558,7 +558,12 @@ class ApiV1Dot1Controller extends Controller $verify->random_token = $rtoken; $verify->save(); - $appUrl = url('/api/v1.1/auth/iarer?ut=' . $user->app_register_token . '&rt=' . $rtoken); + $params = http_build_query([ + 'ut' => $user->app_register_token, + 'rt' => $rtoken, + 'ea' => base64_encode($user->email) + ]); + $appUrl = url('/api/v1.1/auth/iarer?'. $params); Mail::to($user->email)->send(new ConfirmAppEmail($verify, $appUrl)); @@ -571,14 +576,17 @@ class ApiV1Dot1Controller extends Controller { $this->validate($request, [ 'ut' => 'required', - 'rt' => 'required' + 'rt' => 'required', + 'ea' => 'required' ]); $ut = $request->input('ut'); $rt = $request->input('rt'); + $ea = $request->input('ea'); $params = http_build_query([ 'ut' => $ut, 'rt' => $rt, - 'domain' => config('pixelfed.domain.app') + 'domain' => config('pixelfed.domain.app'), + 'ea' => $ea ]); $url = 'pixelfed://confirm-account/'. $ut . '?' . $params; return redirect()->away($url);