Skip to content

Commit d15b6de

Browse files
committed
log on token check failure other than 401
1 parent 92fd96b commit d15b6de

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Coder Desktop/Coder Desktop/State.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ import CoderSDK
22
import Foundation
33
import KeychainAccess
44
import NetworkExtension
5+
import os
56
import SwiftUI
67

78
@MainActor
89
class AppState: ObservableObject {
10+
private let logger = Logger(subsystem: Bundle.main.bundleIdentifier!, category: "AppState")
911
let appId = Bundle.main.bundleIdentifier!
1012

1113
// Stored in UserDefaults
@@ -96,7 +98,7 @@ class AppState: ObservableObject {
9698
if hasSession {
9799
_sessionToken = Published(initialValue: keychainGet(for: Keys.sessionToken))
98100
if sessionToken == nil || sessionToken!.isEmpty == true {
99-
hasSession = false
101+
clearSession()
100102
}
101103
}
102104
}
@@ -120,6 +122,7 @@ class AppState: ObservableObject {
120122
}
121123
} catch {
122124
// Some other failure, we'll show an error if they try and do something
125+
logger.error("failed to check token validity: \(error)")
123126
return
124127
}
125128
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy