FindMemberPwVerifyinputController.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace Themes\Pro\modunawa\app\Http\Controllers\Auth;
  3. use App\Events\PasswordRemindCreated;
  4. use App\Http\Controllers\Controller;
  5. use App\Services\CallApiService;
  6. class FindMemberPwVerifyinputController extends Controller
  7. {
  8. private $callApiService;
  9. public function __construct(CallApiService $callApiService)
  10. {
  11. $this->callApiService = $callApiService;
  12. }
  13. public function emailVerifyinput()
  14. {
  15. $memberPasswdEmail = $this->callApiService->callApi([
  16. 'url' => 'member-passwd-email',
  17. 'data' => [
  18. 'Email' => request('email')
  19. ]
  20. ]);
  21. if ($this->callApiService->verifyApiError($memberPasswdEmail)) {
  22. notify()->error($memberPasswdEmail['body'], 'Error', 'bottomRight');
  23. return redirect()->back();
  24. }
  25. event(new PasswordRemindCreated([
  26. 'email' => request('email'),
  27. 'reset_code' => $memberPasswdEmail['ResetCode']
  28. ]));
  29. return redirect()->route('member-go-email');
  30. }
  31. }