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)