FindUserPwVerifyController.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace App\Http\Controllers\Auth;
  3. use App\Http\Controllers\Controller;
  4. use App\Services\CallApiService;
  5. class FindUserPwVerifyController extends Controller
  6. {
  7. private $callApiService;
  8. public function __construct(CallApiService $callApiService)
  9. {
  10. $this->callApiService = $callApiService;
  11. }
  12. public function index()
  13. {
  14. $userPick = $this->callApiService->callApi([
  15. 'url' => 'users-pick',
  16. 'data' => [
  17. 'Page' => [ ['Email' => request('email')] ]
  18. ]
  19. ]);
  20. if ($this->callApiService->verifyApiError($userPick)) {
  21. notify()->error('이메일 계정이 존재하지 않습니다.', 'Error', 'bottomRight');
  22. return redirect()->back();
  23. }
  24. return view('auth.find-user-pw-verify', [
  25. 'email' => request('email')
  26. ]);
  27. }
  28. public function store()
  29. {
  30. switch (request('auth')) {
  31. case 'mobile':
  32. return redirect()->route('find-user-pw-verifyinput');
  33. case 'email':
  34. return redirect()->route('find-user-pw-verifyinput', ['email' => request('email')]);
  35. default:
  36. return redirect()->back();
  37. }
  38. }
  39. }