From 13567217a7801cc5f847ef4a0a8bdd15d9c09d9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Tue, 24 Feb 2026 19:03:24 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20[esign]=20=EB=A1=9C=EA=B7=B8=EC=9D=B8?= =?UTF-8?q?=20=ED=8E=98=EC=9D=B4=EC=A7=80=EC=97=90=20=EC=A0=84=EC=9E=90?= =?UTF-8?q?=EA=B3=84=EC=95=BD=20=EC=84=9C=EB=AA=85=20=EB=B0=94=EB=A1=9C?= =?UTF-8?q?=EA=B0=80=EA=B8=B0=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 알림톡 버튼 클릭 시 전화번호 입력으로 서명 페이지 이동 - 바로빌 템플릿 URL 변경 전 임시 우회 방법 --- .../ESign/EsignPublicController.php | 24 ++++++++++++++++ resources/views/auth/login.blade.php | 28 +++++++++++++++++++ routes/web.php | 3 ++ 3 files changed, 55 insertions(+) diff --git a/app/Http/Controllers/ESign/EsignPublicController.php b/app/Http/Controllers/ESign/EsignPublicController.php index eb5a35a4..7dffc204 100644 --- a/app/Http/Controllers/ESign/EsignPublicController.php +++ b/app/Http/Controllers/ESign/EsignPublicController.php @@ -22,6 +22,30 @@ class EsignPublicController extends Controller { + // ─── 전자계약 서명 확인 (전화번호 기반) ─── + + public function verifyPhone(Request $request) + { + $phone = preg_replace('/[^0-9]/', '', $request->input('phone', '')); + + if (strlen($phone) < 10) { + return back()->withErrors(['phone' => '올바른 전화번호를 입력해 주세요.']); + } + + $signer = EsignSigner::withoutGlobalScopes() + ->where('phone', $phone) + ->whereIn('status', ['pending', 'notified']) + ->whereHas('contract', fn ($q) => $q->where('status', 'pending')) + ->latest('created_at') + ->first(); + + if (! $signer) { + return back()->withErrors(['phone' => '대기 중인 전자계약이 없습니다.']); + } + + return redirect("/esign/sign/{$signer->access_token}"); + } + // ─── 화면 라우트 ─── public function auth(string $token): View diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index 5a29e2a5..685b46ce 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -80,6 +80,34 @@ class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:rin + + {{-- 전자계약 서명 바로가기 --}} +
+

전자계약 서명하기

+

카카오톡으로 서명 요청을 받으셨나요? 전화번호를 입력하세요.

+ + @if ($errors->has('phone')) +
+ + + + {{ $errors->first('phone') }} +
+ @endif + +
+ @csrf + + +
+
diff --git a/routes/web.php b/routes/web.php index 00d05035..b8247417 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1583,6 +1583,9 @@ | SAM E-Sign Public Routes (인증 불필요 - 서명자용) |-------------------------------------------------------------------------- */ +// 전자계약 전화번호 확인 (공개, 비인증) +Route::post('/esign/verify-phone', [EsignPublicController::class, 'verifyPhone'])->name('esign.verify-phone'); + Route::prefix('esign/sign')->group(function () { // 화면 라우트 Route::get('/{token}', [EsignPublicController::class, 'auth'])->name('esign.sign.auth');