feat(auth): 인증 후 콘텐츠 설정과 개발용 모의 인증을 추가한다

This commit is contained in:
Yu Sung
2026-10-13 11:37:03 +09:00
parent e34a51b411
commit 61bfa46c11
20 changed files with 1203 additions and 181 deletions
+16 -19
View File
@@ -7,7 +7,6 @@
import SwiftUI
import Bootpay
import BootpayUI
struct ChatTabView: View {
@AppStorage("token") private var token: String = UserDefaults.string(forKey: UserDefaultsKey.token)
@AppStorage("auth") private var auth: Bool = UserDefaults.bool(forKey: UserDefaultsKey.auth)
@@ -159,33 +158,30 @@ struct ChatTabView: View {
payload.orderName = "본인인증"
payload.authenticationId = "\(UserDefaults.string(forKey: .nickname))__\(String(NSTimeIntervalSince1970))"
}
.fullScreenCover(isPresented: $isShowAuthView) {
BootpayUI(payload: payload, requestType: BootpayRequest.TYPE_AUTHENTICATION)
.onConfirm { _ in
true
}
.onCancel { _ in
.fullScreenCover(isPresented: $isShowAuthView, onDismiss: mypageViewModel.presentAuthContentSettings) {
AuthVerificationView(
payload: payload,
onCancel: {
isShowAuthView = false
}
.onError { _ in
},
onError: {
AppState.shared.errorMessage = I18n.Chat.Auth.authenticationError
AppState.shared.isShowErrorPopup = true
isShowAuthView = false
}
.onDone {
DEBUG_LOG("onDone: \($0)")
},
onDone: {
let action = pendingAction
mypageViewModel.authVerify($0) {
auth = true
isShowAuthView = false
if let action = pendingAction {
pendingAction = nil
action()
}
pendingAction = nil
action?()
}
}
.onClose {
isShowAuthView = false
},
onClose: {
isShowAuthView = false
}
)
}
if isShowAuthConfirmView {
@@ -206,6 +202,7 @@ struct ChatTabView: View {
)
}
}
.authContentSettings(viewModel: mypageViewModel)
}
}