Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
de71ec2794 | ||
|
|
ac17ce154f | ||
|
|
d2eac62897 | ||
|
|
8c64fc50ad | ||
|
|
b2c138f665 | ||
|
|
aa6c299e2a |
@@ -15,9 +15,9 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>1.2.1-beta.3</string>
|
<string>1.2.1-beta.5</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>51</string>
|
<string>53</string>
|
||||||
<key>LSMinimumSystemVersion</key>
|
<key>LSMinimumSystemVersion</key>
|
||||||
<string>13.0</string>
|
<string>13.0</string>
|
||||||
<key>LSUIElement</key>
|
<key>LSUIElement</key>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ struct LoginWebView: NSViewRepresentable {
|
|||||||
|
|
||||||
let webView = WKWebView(frame: .zero, configuration: config)
|
let webView = WKWebView(frame: .zero, configuration: config)
|
||||||
webView.navigationDelegate = context.coordinator
|
webView.navigationDelegate = context.coordinator
|
||||||
webView.load(URLRequest(url: URL(string: "https://claude.ai")!))
|
webView.load(URLRequest(url: URL(string: "https://claude.ai/login")!))
|
||||||
return webView
|
return webView
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36,12 +36,10 @@ struct LoginWebView: NSViewRepresentable {
|
|||||||
if let url = webView.url?.absoluteString,
|
if let url = webView.url?.absoluteString,
|
||||||
url.contains("/login") || url.contains("/auth") { return }
|
url.contains("/login") || url.contains("/auth") { return }
|
||||||
|
|
||||||
|
// URL is not a login/auth page, so if any claude.ai cookie exists we're signed in
|
||||||
WKWebsiteDataStore.default().httpCookieStore.getAllCookies { cookies in
|
WKWebsiteDataStore.default().httpCookieStore.getAllCookies { cookies in
|
||||||
let hasSession = cookies.contains {
|
let hasAnyCookie = cookies.contains { $0.domain.contains("claude.ai") }
|
||||||
$0.domain.contains("claude.ai") &&
|
guard hasAnyCookie, !self.didAuthenticate else { return }
|
||||||
($0.name == "sessionKey" || $0.name == "__Secure-next-auth.session-token")
|
|
||||||
}
|
|
||||||
guard hasSession, !self.didAuthenticate else { return }
|
|
||||||
self.didAuthenticate = true
|
self.didAuthenticate = true
|
||||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
|
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
|
||||||
self.onAuthenticated()
|
self.onAuthenticated()
|
||||||
|
|||||||
@@ -43,11 +43,8 @@ class UsageViewModel: ObservableObject {
|
|||||||
|
|
||||||
private func checkInitialSignInState() async {
|
private func checkInitialSignInState() async {
|
||||||
let cookies = await WKWebsiteDataStore.default().httpCookieStore.allCookies()
|
let cookies = await WKWebsiteDataStore.default().httpCookieStore.allCookies()
|
||||||
let hasSession = cookies.contains {
|
let hasAnyCookie = cookies.contains { $0.domain.contains("claude.ai") }
|
||||||
$0.domain.contains("claude.ai") &&
|
if hasAnyCookie { isSignedIn = true }
|
||||||
($0.name == "sessionKey" || $0.name == "__Secure-next-auth.session-token")
|
|
||||||
}
|
|
||||||
if hasSession { isSignedIn = true }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func signOut() async {
|
func signOut() async {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
[](https://swift.org)
|
[](https://swift.org)
|
||||||
[](https://github.com/superdooper86/claudechecker/releases)
|
[](https://github.com/superdooper86/claudechecker/releases)
|
||||||
[](LICENSE)
|
[](LICENSE)
|
||||||
[](https://github.com/superdooper86/claudechecker/releases/tag/v1.2.1-beta.2) <!-- BETA_BADGE -->
|
[](https://github.com/superdooper86/claudechecker/releases/tag/v1.2.1-beta.4) <!-- BETA_BADGE -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -3,7 +3,6 @@
|
|||||||
### Bug fixes
|
### Bug fixes
|
||||||
- Fixed "Not signed in" showing incorrectly on launch when the session was already active
|
- Fixed "Not signed in" showing incorrectly on launch when the session was already active
|
||||||
- Sign-in state is now detected immediately from stored cookies on startup, before the first data refresh completes
|
- Sign-in state is now detected immediately from stored cookies on startup, before the first data refresh completes
|
||||||
- Fixed Re-authenticate (and Sign In) not detecting an existing session — the login window now loads `claude.ai` directly so already-signed-in users are detected correctly and the window auto-dismisses
|
- Fixed login window auto-closing before the user could sign in — the login window now correctly loads the `/login` page so it only detects auth after the actual sign-in redirect
|
||||||
- Fixed "No API key configured" showing after signing out — now correctly shows "Not signed in" with a prompt to sign in
|
- Fixed "No API key configured" showing after signing out — now correctly shows "Not signed in" with a prompt to sign in
|
||||||
- Added `/api/organizations` as a final fallback for org ID resolution when the bootstrap API response doesn't include it
|
- Added `/api/organizations` as a final fallback for org ID resolution when the bootstrap API response doesn't include it
|
||||||
- Session cookie detection now checks both `sessionKey` and `__Secure-next-auth.session-token` cookie names
|
|
||||||
|
|||||||
+3
-3
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"version": "1.2.1-beta.2",
|
"version": "1.2.1-beta.4",
|
||||||
"url": "https://github.com/superdooper86/claudechecker/releases/download/v1.2.1-beta.2/ClaudeChecker.zip",
|
"url": "https://github.com/superdooper86/claudechecker/releases/download/v1.2.1-beta.4/ClaudeChecker.zip",
|
||||||
"notes": "## What's new in v1.2.1\n\n### Bug fixes\n- Fixed \"Not signed in\" showing incorrectly on launch when the session was already active\n- Sign-in state is now detected immediately from stored cookies on startup, before the first data refresh completes\n- Fixed Re-authenticate (and Sign In) not detecting an existing session — the login window now loads `claude.ai` directly so already-signed-in users are detected correctly and the window auto-dismisses\n- Added `/api/organizations` as a final fallback for org ID resolution when the bootstrap API response doesn't include it\n- Session cookie detection now checks both `sessionKey` and `__Secure-next-auth.session-token` cookie names"
|
"notes": "## What's new in v1.2.1\n\n### Bug fixes\n- Fixed \"Not signed in\" showing incorrectly on launch when the session was already active\n- Sign-in state is now detected immediately from stored cookies on startup, before the first data refresh completes\n- Fixed Re-authenticate (and Sign In) not detecting an existing session — the login window now loads `claude.ai` directly so already-signed-in users are detected correctly and the window auto-dismisses\n- Fixed \"No API key configured\" showing after signing out — now correctly shows \"Not signed in\" with a prompt to sign in\n- Added `/api/organizations` as a final fallback for org ID resolution when the bootstrap API response doesn't include it\n- Session cookie detection now checks both `sessionKey` and `__Secure-next-auth.session-token` cookie names"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user