From 9c51669691ac3feb570b906f81be8b758cbfbb12 Mon Sep 17 00:00:00 2001 From: Kamil Sosna Date: Mon, 9 Sep 2024 12:16:35 +0200 Subject: [PATCH] Removed old NSSecureCoding conformance --- Auth0/Credentials.swift | 39 --------------------------------------- 1 file changed, 39 deletions(-) diff --git a/Auth0/Credentials.swift b/Auth0/Credentials.swift index b1e20034..413dd3bb 100644 --- a/Auth0/Credentials.swift +++ b/Auth0/Credentials.swift @@ -155,42 +155,3 @@ extension Credentials: Codable { try values.encode(expiresIn.timeIntervalSinceNow, forKey: .expiresIn) } } - -// MARK: - NSSecureCoding - -extension Credentials: NSSecureCoding { - - /// `NSSecureCoding` decoding initializer. - public convenience init?(coder aDecoder: NSCoder) { - let accessToken = aDecoder.decodeObject(of: NSString.self, forKey: "accessToken") - let tokenType = aDecoder.decodeObject(of: NSString.self, forKey: "tokenType") - let idToken = aDecoder.decodeObject(of: NSString.self, forKey: "idToken") - let refreshToken = aDecoder.decodeObject(of: NSString.self, forKey: "refreshToken") - let expiresIn = aDecoder.decodeObject(of: NSDate.self, forKey: "expiresIn") - let scope = aDecoder.decodeObject(of: NSString.self, forKey: "scope") - let recoveryCode = aDecoder.decodeObject(of: NSString.self, forKey: "recoveryCode") - - self.init(accessToken: accessToken as String? ?? "", - tokenType: tokenType as String? ?? "", - idToken: idToken as String? ?? "", - refreshToken: refreshToken as String?, - expiresIn: expiresIn as Date? ?? Date(), - scope: scope as String?, - recoveryCode: recoveryCode as String?) - } - - /// `NSSecureCoding` encoding method. - public func encode(with aCoder: NSCoder) { - aCoder.encode(self.accessToken as NSString, forKey: "accessToken") - aCoder.encode(self.tokenType as NSString, forKey: "tokenType") - aCoder.encode(self.idToken as NSString, forKey: "idToken") - aCoder.encode(self.refreshToken as NSString?, forKey: "refreshToken") - aCoder.encode(self.expiresIn as NSDate, forKey: "expiresIn") - aCoder.encode(self.scope as NSString?, forKey: "scope") - aCoder.encode(self.recoveryCode as NSString?, forKey: "recoveryCode") - } - - /// Property that enables secure coding. Equals to `true`. - public static var supportsSecureCoding: Bool { return true } - -}