인증 완료 후 동작 실행

This commit is contained in:
Yu Sung
2026-01-14 11:31:08 +09:00
parent 1b583eabba
commit 4354530372
3 changed files with 29 additions and 15 deletions

View File

@@ -72,7 +72,7 @@ final class MyPageViewModel: ObservableObject {
.store(in: &subscription)
}
func authVerify(_ data: [String: Any]) {
func authVerify(_ data: [String: Any], onSuccess: (() -> Void)? = nil) {
isLoading = true
let _data = data["data"] as? [String: Any]
@@ -102,8 +102,13 @@ final class MyPageViewModel: ObservableObject {
} else {
UserDefaults.set(ContentType.MALE.rawValue, forKey: .contentPreference)
}
AppState.shared.isRestartApp = true
AppState.shared.setAppStep(step: .splash)
if let onSuccess = onSuccess {
onSuccess()
} else {
AppState.shared.isRestartApp = true
AppState.shared.setAppStep(step: .splash)
}
} else {
if let message = decoded.message {
self.errorMessage = message