From 72eed89f59f76619d62de927b6c2929321a68c78 Mon Sep 17 00:00:00 2001 From: Admin Date: Tue, 10 Mar 2026 16:18:43 +0500 Subject: [PATCH] fix(ios): expose public validateToken() overload for post-avatar-upload refresh --- ios/LibNovel/LibNovel/Services/AuthStore.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ios/LibNovel/LibNovel/Services/AuthStore.swift b/ios/LibNovel/LibNovel/Services/AuthStore.swift index a3973e7..6f46ef0 100644 --- a/ios/LibNovel/LibNovel/Services/AuthStore.swift +++ b/ios/LibNovel/LibNovel/Services/AuthStore.swift @@ -85,7 +85,14 @@ final class AuthStore: ObservableObject { } } - // MARK: - Token validation (on cold launch) + // MARK: - Token validation + + /// Re-validates the current session and refreshes `user` + `settings`. + /// Call this after any operation that may change the user record (e.g. avatar upload). + func validateToken() async { + guard let token = loadToken() else { return } + await validateToken(token) + } private func validateToken(_ token: String) async { await APIClient.shared.setAuthCookie(token)