diff --git a/presentation/src/main/assets/web_auth_phone.html b/presentation/src/main/assets/web_auth_phone.html index 9f87bb40..c0d01871 100644 --- a/presentation/src/main/assets/web_auth_phone.html +++ b/presentation/src/main/assets/web_auth_phone.html @@ -24,20 +24,19 @@ }, function (rsp) { if (rsp.success) { - jQuery.ajax({ - url: "{서버의 인증 정보를 받는 endpoint}", - method: "POST", - headers: { "Content-Type": "application/json" }, - data: JSON.stringify({ imp_uid: rsp.imp_uid }), - success: function(response) { - window.AndroidBridge.resultAuth(true, rsp.imp_uid); - }, - error: function(xhr, status, error) { - window.AndroidBridge.resultAuth(false); + $.ajax({ + type : 'POST', + url : '/certifications/confirm', + dataType : 'json', + data : { + imp_uid : rsp.imp_uid } - }); + }).done(function() { + window.AndroidBridge.resultAuth(true, rsp.imp_uid); + }); } else { alert("인증에 실패하였습니다. 에러 내용: " + rsp.error_msg); + window.AndroidBridge.resultAuth(false); } } ); diff --git a/presentation/src/main/java/co/orange/presentation/auth/phone/SmsAuthActivity.kt b/presentation/src/main/java/co/orange/presentation/auth/phone/SmsAuthActivity.kt index 1514aebf..0ad9f79b 100644 --- a/presentation/src/main/java/co/orange/presentation/auth/phone/SmsAuthActivity.kt +++ b/presentation/src/main/java/co/orange/presentation/auth/phone/SmsAuthActivity.kt @@ -38,8 +38,7 @@ class SmsAuthActivity : BaseActivity(R.layout.activity_s setLayerType(View.LAYER_TYPE_HARDWARE, null) scrollBarStyle = WebView.SCROLLBARS_OUTSIDE_OVERLAY isScrollbarFadingEnabled = true -// webChromeClient = myChromeClient() -// webViewClient = WebViewClientClass() + webViewClient = SmsAuthWebViewClient() loadUrl("file:///android_asset/web_auth_phone.html") } } @@ -62,7 +61,7 @@ class SmsAuthActivity : BaseActivity(R.layout.activity_s @JvmStatic fun createIntent(context: Context): Intent = - Intent(context, SmsAuthFactory::class.java).apply { + Intent(context, SmsAuthActivity::class.java).apply { flags = Intent.FLAG_ACTIVITY_SINGLE_TOP } } diff --git a/presentation/src/main/java/co/orange/presentation/auth/phone/SmsAuthWebViewClient.kt b/presentation/src/main/java/co/orange/presentation/auth/phone/SmsAuthWebViewClient.kt new file mode 100644 index 00000000..d7836be7 --- /dev/null +++ b/presentation/src/main/java/co/orange/presentation/auth/phone/SmsAuthWebViewClient.kt @@ -0,0 +1,16 @@ +package co.orange.presentation.auth.phone + +import android.webkit.WebResourceRequest +import android.webkit.WebView +import android.webkit.WebViewClient + +class SmsAuthWebViewClient : WebViewClient() { + override fun shouldOverrideUrlLoading( + view: WebView?, + request: WebResourceRequest?, + ): Boolean { + val url: String = request?.url.toString() + view?.loadUrl(url) + return super.shouldOverrideUrlLoading(view, request) + } +}