From c6c65572adb0bb74b79c4a62702d0551037d6da9 Mon Sep 17 00:00:00 2001 From: Borut Tomazin Date: Tue, 14 May 2024 08:17:47 +0200 Subject: [PATCH] Nullable value. --- Sources/Apple/AppleAuthenticator+Models.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Sources/Apple/AppleAuthenticator+Models.swift b/Sources/Apple/AppleAuthenticator+Models.swift index 49dbd8f..22514d6 100644 --- a/Sources/Apple/AppleAuthenticator+Models.swift +++ b/Sources/Apple/AppleAuthenticator+Models.swift @@ -23,10 +23,11 @@ public extension AppleAuthenticator { public let email: Email public let expiresAt: Date - public var name: String { - [nameComponents?.givenName, nameComponents?.familyName] + public var name: String? { + let fullName = [nameComponents?.givenName, nameComponents?.familyName] .compactMap { $0 } .joined(separator: " ") + return !fullName.isEmpty ? fullName : nil } }