From c5893ff6380ba46ad9c3eafb9a87ef5baf0a7207 Mon Sep 17 00:00:00 2001 From: Stefan Hausotte Date: Mon, 15 Jun 2026 18:49:46 +0200 Subject: [PATCH] fix: clearer login error for security-key (passkey) accounts (#82) Bump ForgejoKit to 0.8.1, which classifies Forgejo's "Basic authorization is not allowed while having security keys enrolled" 401 as a dedicated error instead of "Invalid username or password". Accounts with a passkey or security key now get told to use a personal access token. Add the new .basicAuthBlockedBySecurityKey case to the session-restore error mapping (routed through the auth-category path like other 401s). Closes #78 Reviewed-on: https://codeberg.org/secana/Forji/pulls/82 --- Forji/Forji.xcodeproj/project.pbxproj | 2 +- .../project.xcworkspace/xcshareddata/swiftpm/Package.resolved | 4 ++-- Forji/Forji/Services/AuthenticationService.swift | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Forji/Forji.xcodeproj/project.pbxproj b/Forji/Forji.xcodeproj/project.pbxproj index 3545c79..7a25f67 100644 --- a/Forji/Forji.xcodeproj/project.pbxproj +++ b/Forji/Forji.xcodeproj/project.pbxproj @@ -639,7 +639,7 @@ repositoryURL = "https://codeberg.org/secana/ForgejoKit.git"; requirement = { kind = exactVersion; - version = 0.8.0; + version = 0.8.1; }; }; DEC49F6B2F3D00C700E7DD54 /* XCRemoteSwiftPackageReference "textual" */ = { diff --git a/Forji/Forji.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Forji/Forji.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 78791f3..826c240 100644 --- a/Forji/Forji.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Forji/Forji.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -6,8 +6,8 @@ "kind" : "remoteSourceControl", "location" : "https://codeberg.org/secana/ForgejoKit.git", "state" : { - "revision" : "485c147e7f9762c06f51029de47464fb41abc4af", - "version" : "0.8.0" + "revision" : "7675312f5ca302968e267aad632bec4c76414e06", + "version" : "0.8.1" } }, { diff --git a/Forji/Forji/Services/AuthenticationService.swift b/Forji/Forji/Services/AuthenticationService.swift index 64ca743..6089481 100644 --- a/Forji/Forji/Services/AuthenticationService.swift +++ b/Forji/Forji/Services/AuthenticationService.swift @@ -269,7 +269,7 @@ enum SessionRestoreError: LocalizedError, Equatable { .invalidServerResponse case .invalidURL: .serverNotFound - case .invalidCredentials, .otpRequired, .serverNotFound, .unknownError: + case .invalidCredentials, .otpRequired, .basicAuthBlockedBySecurityKey, .serverNotFound, .unknownError: fromHTTPErrorCategory(error.httpErrorCategory, statusCode: error.httpStatusCode) } }