Skip to content

Commit

Permalink
mask displayed API key
Browse files Browse the repository at this point in the history
  • Loading branch information
ski-u committed Aug 19, 2024
1 parent 630e9a6 commit f44a6dc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Features/Sources/Settings/Settings/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public struct SettingsView: View {

Spacer()

Text(APIClient.apiKey?.rawValue ?? "None")
Text(APIClient.apiKey?.rawValue.masked ?? "None")
.foregroundStyle(Color.secondary)
}
}
Expand Down
8 changes: 8 additions & 0 deletions Features/Sources/Settings/String.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
extension String {
var masked: String? {
guard let first = self.first else {
return nil
}
return "\(first)***"
}
}

0 comments on commit f44a6dc

Please sign in to comment.