From 1ebf76bc664c74171878ac40793e9f588f173fa5 Mon Sep 17 00:00:00 2001 From: Joel-David Date: Sat, 15 Jun 2024 21:55:31 +0800 Subject: [PATCH] fix: QR scan --- Chronos/Services/OTPService.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Chronos/Services/OTPService.swift b/Chronos/Services/OTPService.swift index 3a89a1e..3365d53 100644 --- a/Chronos/Services/OTPService.swift +++ b/Chronos/Services/OTPService.swift @@ -50,10 +50,17 @@ public class OTPService { throw OTPError.invalidURL } + var path = components.path + let tokenType = try getTokenType(from: host) var token = Token() token.type = tokenType + if !path.isEmpty { + path.remove(at: path.startIndex) + token.account = path + } + try updateToken(&token, with: components.queryItems) return token