mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-22 04:53:17 +00:00
commit
1b211edc34
2 changed files with 14 additions and 3 deletions
|
@ -475,8 +475,6 @@ class ApiV1Dot1Controller extends Controller
|
|||
},
|
||||
],
|
||||
'password' => 'required|string|min:8',
|
||||
// 'avatar' => 'required|mimetypes:image/jpeg,image/png|max:15000',
|
||||
// 'bio' => 'required|max:140'
|
||||
]);
|
||||
|
||||
$email = $request->input('email');
|
||||
|
@ -507,7 +505,7 @@ class ApiV1Dot1Controller extends Controller
|
|||
$verify->random_token = $rtoken;
|
||||
$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));
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
abort_if($request->user(), 404);
|
||||
|
|
|
@ -154,6 +154,7 @@ Route::group(['prefix' => 'api'], function() use($middleware) {
|
|||
Route::get('iarpfc', 'Api\ApiV1Dot1Controller@inAppRegistrationPreFlightCheck');
|
||||
Route::post('iar', 'Api\ApiV1Dot1Controller@inAppRegistration');
|
||||
Route::post('iarc', 'Api\ApiV1Dot1Controller@inAppRegistrationConfirm');
|
||||
Route::get('iarer', 'Api\ApiV1Dot1Controller@inAppRegistrationEmailRedirect');
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue