middleware('front'); } /** * 아이디 찾기 * @method GET * @see /auth/findID */ public function index() { return view('auth.findID.index', []); } /** * 아이디 찾기 결과 * @method POST * @see /auth/findID */ public function store(Request $request, TossCertLog $tossCertLogModel, User $userModel) { try { $token = $request->cookie('tossAccessToken'); if (!$token) { throw new Exception('토스 인증 절차가 잘못되었습니다. 다시 시도해주세요.'); } $txId = $request->post('tx_id'); $token = unserialize($token); // 토스 본인확인 결과 조회 $result = $this->getTossCertResult($token, $txId); // 토스 인증 결과 기록 $tossCertLogModel->register($result); unset($request, $txId, $token, $tossCertLogModel); // 아이디 찾기 결과 보기 return view('auth.findID.result', [ 'user' => $userModel->findUserByTossCI($result->success->personalData->ci) ]); } catch (Exception $e) { return redirect()->route('auth.findID')->withErrors('message', $e->getMessage()); } } }