@@ -30,8 +30,9 @@ import SalesforceSDKCore
3030
3131struct UserCredentialsView : View {
3232 @Binding var isExpanded : Bool
33+ let refreshTrigger : UUID
3334
34- // Section expansion states - all start expanded
35+ // Section expansion states - all start collapsed
3536 @State private var userIdentityExpanded = false
3637 @State private var oauthConfigExpanded = false
3738 @State private var tokensExpanded = false
@@ -62,69 +63,71 @@ struct UserCredentialsView: View {
6263 }
6364
6465 if isExpanded {
65- InfoSectionView ( title: " User Identity " , isExpanded: $userIdentityExpanded) {
66- InfoRowView ( label: " Username: " , value: username)
67- InfoRowView ( label: " User ID: " , value: userId)
68- InfoRowView ( label: " Organization ID: " , value: organizationId)
69- }
70-
71- InfoSectionView ( title: " OAuth Client Configuration " , isExpanded: $oauthConfigExpanded) {
72- InfoRowView ( label: " Client ID: " , value: clientId, isSensitive: true )
73- InfoRowView ( label: " Redirect URI: " , value: redirectUri)
74- InfoRowView ( label: " Protocol: " , value: authProtocol)
75- InfoRowView ( label: " Domain: " , value: domain)
76- InfoRowView ( label: " Identifier: " , value: identifier)
77- }
78-
79- InfoSectionView ( title: " Tokens " , isExpanded: $tokensExpanded) {
80- InfoRowView ( label: " Access Token: " , value: accessToken, isSensitive: true )
81- InfoRowView ( label: " Refresh Token: " , value: refreshToken, isSensitive: true )
82- InfoRowView ( label: " Token Format: " , value: tokenFormat)
83- InfoRowView ( label: " JWT: " , value: jwt, isSensitive: true )
84- InfoRowView ( label: " Auth Code: " , value: authCode, isSensitive: true )
85- InfoRowView ( label: " Challenge String: " , value: challengeString, isSensitive: true )
86- InfoRowView ( label: " Issued At: " , value: issuedAt)
87- }
88-
89- InfoSectionView ( title: " URLs " , isExpanded: $urlsExpanded) {
90- InfoRowView ( label: " Instance URL: " , value: instanceUrl)
91- InfoRowView ( label: " API Instance URL: " , value: apiInstanceUrl)
92- InfoRowView ( label: " API URL: " , value: apiUrl)
93- InfoRowView ( label: " Identity URL: " , value: identityUrl)
94- }
95-
96- InfoSectionView ( title: " Community " , isExpanded: $communityExpanded) {
97- InfoRowView ( label: " Community ID: " , value: communityId)
98- InfoRowView ( label: " Community URL: " , value: communityUrl)
99- }
100-
101- InfoSectionView ( title: " Domains and SIDs " , isExpanded: $domainsAndSidsExpanded) {
102- InfoRowView ( label: " Lightning Domain: " , value: lightningDomain)
103- InfoRowView ( label: " Lightning SID: " , value: lightningSid, isSensitive: true )
104- InfoRowView ( label: " VF Domain: " , value: vfDomain)
105- InfoRowView ( label: " VF SID: " , value: vfSid, isSensitive: true )
106- InfoRowView ( label: " Content Domain: " , value: contentDomain)
107- InfoRowView ( label: " Content SID: " , value: contentSid, isSensitive: true )
108- InfoRowView ( label: " Parent SID: " , value: parentSid, isSensitive: true )
109- InfoRowView ( label: " SID Cookie Name: " , value: sidCookieName)
110- }
111-
112- InfoSectionView ( title: " Cookies and Security " , isExpanded: $cookiesAndSecurityExpanded) {
113- InfoRowView ( label: " CSRF Token: " , value: csrfToken, isSensitive: true )
114- InfoRowView ( label: " Cookie Client Src: " , value: cookieClientSrc)
115- InfoRowView ( label: " Cookie SID Client: " , value: cookieSidClient, isSensitive: true )
116- }
117-
118- InfoSectionView ( title: " Beacon " , isExpanded: $beaconExpanded) {
119- InfoRowView ( label: " Beacon Child Consumer Key: " , value: beaconChildConsumerKey)
120- InfoRowView ( label: " Beacon Child Consumer Secret: " , value: beaconChildConsumerSecret, isSensitive: true )
121- }
122-
123- InfoSectionView ( title: " Other " , isExpanded: $otherExpanded) {
124- InfoRowView ( label: " Scopes: " , value: credentialsScopes)
125- InfoRowView ( label: " Encrypted: " , value: encrypted)
126- InfoRowView ( label: " Additional OAuth Fields: " , value: additionalOAuthFields)
66+ VStack ( spacing: 8 ) {
67+ InfoSectionView ( title: " User Identity " , isExpanded: $userIdentityExpanded) {
68+ InfoRowView ( label: " Username: " , value: username)
69+ InfoRowView ( label: " User ID: " , value: userId)
70+ InfoRowView ( label: " Organization ID: " , value: organizationId)
71+ }
72+
73+ InfoSectionView ( title: " OAuth Client Configuration " , isExpanded: $oauthConfigExpanded) {
74+ InfoRowView ( label: " Client ID: " , value: clientId, isSensitive: true )
75+ InfoRowView ( label: " Redirect URI: " , value: redirectUri)
76+ InfoRowView ( label: " Protocol: " , value: authProtocol)
77+ InfoRowView ( label: " Domain: " , value: domain)
78+ InfoRowView ( label: " Identifier: " , value: identifier)
79+ }
80+
81+ InfoSectionView ( title: " Tokens " , isExpanded: $tokensExpanded) {
82+ InfoRowView ( label: " Access Token: " , value: accessToken, isSensitive: true )
83+ InfoRowView ( label: " Refresh Token: " , value: refreshToken, isSensitive: true )
84+ InfoRowView ( label: " Token Format: " , value: tokenFormat)
85+ InfoRowView ( label: " JWT: " , value: jwt, isSensitive: true )
86+ InfoRowView ( label: " Auth Code: " , value: authCode, isSensitive: true )
87+ InfoRowView ( label: " Challenge String: " , value: challengeString, isSensitive: true )
88+ InfoRowView ( label: " Issued At: " , value: issuedAt)
89+ InfoRowView ( label: " Scopes: " , value: credentialsScopes)
90+ }
91+
92+ InfoSectionView ( title: " URLs " , isExpanded: $urlsExpanded) {
93+ InfoRowView ( label: " Instance URL: " , value: instanceUrl)
94+ InfoRowView ( label: " API Instance URL: " , value: apiInstanceUrl)
95+ InfoRowView ( label: " API URL: " , value: apiUrl)
96+ InfoRowView ( label: " Identity URL: " , value: identityUrl)
97+ }
98+
99+ InfoSectionView ( title: " Community " , isExpanded: $communityExpanded) {
100+ InfoRowView ( label: " Community ID: " , value: communityId)
101+ InfoRowView ( label: " Community URL: " , value: communityUrl)
102+ }
103+
104+ InfoSectionView ( title: " Domains and SIDs " , isExpanded: $domainsAndSidsExpanded) {
105+ InfoRowView ( label: " Lightning Domain: " , value: lightningDomain)
106+ InfoRowView ( label: " Lightning SID: " , value: lightningSid, isSensitive: true )
107+ InfoRowView ( label: " VF Domain: " , value: vfDomain)
108+ InfoRowView ( label: " VF SID: " , value: vfSid, isSensitive: true )
109+ InfoRowView ( label: " Content Domain: " , value: contentDomain)
110+ InfoRowView ( label: " Content SID: " , value: contentSid, isSensitive: true )
111+ InfoRowView ( label: " Parent SID: " , value: parentSid, isSensitive: true )
112+ InfoRowView ( label: " SID Cookie Name: " , value: sidCookieName)
113+ }
114+
115+ InfoSectionView ( title: " Cookies and Security " , isExpanded: $cookiesAndSecurityExpanded) {
116+ InfoRowView ( label: " CSRF Token: " , value: csrfToken, isSensitive: true )
117+ InfoRowView ( label: " Cookie Client Src: " , value: cookieClientSrc)
118+ InfoRowView ( label: " Cookie SID Client: " , value: cookieSidClient, isSensitive: true )
119+ }
120+
121+ InfoSectionView ( title: " Beacon " , isExpanded: $beaconExpanded) {
122+ InfoRowView ( label: " Beacon Child Consumer Key: " , value: beaconChildConsumerKey)
123+ InfoRowView ( label: " Beacon Child Consumer Secret: " , value: beaconChildConsumerSecret, isSensitive: true )
124+ }
125+
126+ InfoSectionView ( title: " Other " , isExpanded: $otherExpanded) {
127+ InfoRowView ( label: " Additional OAuth Fields: " , value: additionalOAuthFields)
128+ }
127129 }
130+ . id ( refreshTrigger)
128131 }
129132 }
130133 . padding ( )
@@ -204,6 +207,13 @@ struct UserCredentialsView: View {
204207 formatter. timeStyle = . medium
205208 return formatter. string ( from: date)
206209 }
210+
211+ private var credentialsScopes : String {
212+ guard let scopes = credentials? . scopes else {
213+ return " "
214+ }
215+ return scopes. joined ( separator: " " )
216+ }
207217
208218 // URLs
209219 private var instanceUrl : String {
@@ -287,18 +297,6 @@ struct UserCredentialsView: View {
287297 }
288298
289299 // Other
290- private var credentialsScopes : String {
291- guard let scopes = credentials? . scopes else {
292- return " "
293- }
294- return scopes. joined ( separator: " " )
295- }
296-
297- private var encrypted : String {
298- guard let creds = credentials else { return " " }
299- return creds. isEncrypted ? " Yes " : " No "
300- }
301-
302300 private var additionalOAuthFields : String {
303301 guard let fields = credentials? . additionalOAuthFields,
304302 let jsonData = try ? JSONSerialization . data ( withJSONObject: fields, options: . prettyPrinted) ,
0 commit comments