mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-09 16:24:51 +00:00
Update iar
This commit is contained in:
parent
76961c4119
commit
59e818cbbd
2 changed files with 14 additions and 3 deletions
|
@ -475,8 +475,6 @@ class ApiV1Dot1Controller extends Controller
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
'password' => 'required|string|min:8',
|
'password' => 'required|string|min:8',
|
||||||
// 'avatar' => 'required|mimetypes:image/jpeg,image/png|max:15000',
|
|
||||||
// 'bio' => 'required|max:140'
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$email = $request->input('email');
|
$email = $request->input('email');
|
||||||
|
@ -507,7 +505,7 @@ class ApiV1Dot1Controller extends Controller
|
||||||
$verify->random_token = $rtoken;
|
$verify->random_token = $rtoken;
|
||||||
$verify->save();
|
$verify->save();
|
||||||
|
|
||||||
$appUrl = 'pixelfed://confirm-account/'. $user->app_register_token . '?rt=' . $rtoken;
|
$appUrl = url('/api/v1.1/auth/iarer?ut=' . $user->app_register_token . '&rt=' . $rtoken);
|
||||||
|
|
||||||
Mail::to($user->email)->send(new ConfirmAppEmail($verify, $appUrl));
|
Mail::to($user->email)->send(new ConfirmAppEmail($verify, $appUrl));
|
||||||
|
|
||||||
|
@ -516,6 +514,18 @@ class ApiV1Dot1Controller extends Controller
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function inAppRegistrationEmailRedirect(Request $request)
|
||||||
|
{
|
||||||
|
$this->validate($request, [
|
||||||
|
'ut' => 'required',
|
||||||
|
'rt' => 'required'
|
||||||
|
]);
|
||||||
|
$ut = $request->input('ut');
|
||||||
|
$rt = $request->input('rt');
|
||||||
|
$url = 'pixelfed://confirm-account/'. $ut . '?rt=' . $rt;
|
||||||
|
return redirect()->away($url);
|
||||||
|
}
|
||||||
|
|
||||||
public function inAppRegistrationConfirm(Request $request)
|
public function inAppRegistrationConfirm(Request $request)
|
||||||
{
|
{
|
||||||
abort_if($request->user(), 404);
|
abort_if($request->user(), 404);
|
||||||
|
|
|
@ -154,6 +154,7 @@ Route::group(['prefix' => 'api'], function() use($middleware) {
|
||||||
Route::get('iarpfc', 'Api\ApiV1Dot1Controller@inAppRegistrationPreFlightCheck');
|
Route::get('iarpfc', 'Api\ApiV1Dot1Controller@inAppRegistrationPreFlightCheck');
|
||||||
Route::post('iar', 'Api\ApiV1Dot1Controller@inAppRegistration');
|
Route::post('iar', 'Api\ApiV1Dot1Controller@inAppRegistration');
|
||||||
Route::post('iarc', 'Api\ApiV1Dot1Controller@inAppRegistrationConfirm');
|
Route::post('iarc', 'Api\ApiV1Dot1Controller@inAppRegistrationConfirm');
|
||||||
|
Route::get('iarer', 'Api\ApiV1Dot1Controller@inAppRegistrationEmailRedirect');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue