File tree Expand file tree Collapse file tree 1 file changed +12
-16
lines changed Expand file tree Collapse file tree 1 file changed +12
-16
lines changed Original file line number Diff line number Diff line change @@ -40,8 +40,6 @@ actor GrpcClient: CustomStringConvertible {
4040
4141 private let auth : Auth
4242
43- private let appCheckEnabled = false
44-
4543 private let appCheck : AppCheck ?
4644
4745 private enum RequestHeaders {
@@ -195,22 +193,20 @@ actor GrpcClient: CustomStringConvertible {
195193 }
196194
197195 // Add AppCheck token if available
198- if appCheckEnabled {
199- do {
200- if let token = try await appCheck? . token ( forcingRefresh: false ) {
201- headers. add ( name: RequestHeaders . appCheckHeader, value: " \( token) " )
202- FirebaseLogger . dataConnect
203- . debug ( " App Check token added: \( token) " )
204- } else {
205- FirebaseLogger . dataConnect
206- . debug ( " App Check token unavailable. Not adding App Check header. " )
207- }
208- } catch {
196+ do {
197+ if let token = try await appCheck? . token ( forcingRefresh: false ) {
198+ headers. add ( name: RequestHeaders . appCheckHeader, value: token. token)
199+ FirebaseLogger . dataConnect
200+ . debug ( " App Check token added: \( token. token) " )
201+ } else {
209202 FirebaseLogger . dataConnect
210- . debug (
211- " Cannot get App Check token successfully due to: \( error) . Not adding App Check header. "
212- )
203+ . debug ( " App Check token unavailable. Not adding App Check header. " )
213204 }
205+ } catch {
206+ FirebaseLogger . dataConnect
207+ . debug (
208+ " Cannot get App Check token successfully due to: \( error) . Not adding App Check header. "
209+ )
214210 }
215211
216212 let options = CallOptions ( customMetadata: headers)
You can’t perform that action at this time.
0 commit comments