Skip to content

Commit

Permalink
Nullable value.
Browse files Browse the repository at this point in the history
  • Loading branch information
borut-t committed May 14, 2024
1 parent 4f4e763 commit c6c6557
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Sources/Apple/AppleAuthenticator+Models.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down

0 comments on commit c6c6557

Please sign in to comment.