Skip to content

Commit c070fc5

Browse files
committed
Various fixes
1 parent df79d27 commit c070fc5

File tree

6 files changed

+27
-23
lines changed

6 files changed

+27
-23
lines changed

FirebaseAuth/Sources/Swift/Backend/RPC/CreateAuthURIRequest.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class CreateAuthURIRequest: IdentityToolkitRequest, AuthRPCRequest {
4848
typealias Response = CreateAuthURIResponse
4949

5050
/// The email or federated ID of the user.
51-
private let identifier: String
51+
let identifier: String
5252

5353
/// The URI to which the IDP redirects the user after the federated login flow.
5454
private let continueURI: String

FirebaseAuth/Sources/Swift/Backend/RPC/GetOOBConfirmationCodeRequest.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class GetOOBConfirmationCodeRequest: IdentityToolkitRequest, AuthRPCRequest {
110110
private let requestType: GetOOBConfirmationCodeRequestType
111111

112112
/// The email of the user for password reset.
113-
private let email: String?
113+
let email: String?
114114

115115
/// The new email to be updated for verifyBeforeUpdateEmail.
116116
private let updatedEmail: String?
@@ -119,7 +119,7 @@ class GetOOBConfirmationCodeRequest: IdentityToolkitRequest, AuthRPCRequest {
119119
private let accessToken: String?
120120

121121
/// This URL represents the state/Continue URL in the form of a universal link.
122-
private let continueURL: String?
122+
let continueURL: String?
123123

124124
/// The iOS bundle Identifier, if available.
125125
private let iOSBundleID: String?
@@ -135,16 +135,16 @@ class GetOOBConfirmationCodeRequest: IdentityToolkitRequest, AuthRPCRequest {
135135

136136
/// Indicates whether the action code link will open the app directly or after being
137137
/// redirected from a Firebase owned web widget.
138-
private let handleCodeInApp: Bool
138+
let handleCodeInApp: Bool
139139

140140
/// The Firebase Dynamic Link domain used for out of band code flow.
141141
private let dynamicLinkDomain: String?
142142

143143
/// Response to the captcha.
144-
private(set) var captchaResponse: String?
144+
var captchaResponse: String?
145145

146146
/// The reCAPTCHA version.
147-
private(set) var recaptchaVersion: String?
147+
var recaptchaVersion: String?
148148

149149
/// Designated initializer.
150150
/// - Parameter requestType: The types of OOB Confirmation Code to request.

FirebaseAuth/Sources/Swift/Backend/RPC/RevokeTokenRequest.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ class RevokeTokenRequest: IdentityToolkitRequest, AuthRPCRequest {
3737
typealias Response = RevokeTokenResponse
3838

3939
/// The provider that issued the token to revoke.
40-
private let providerID: String
40+
let providerID: String
4141

4242
/// The type of the token to revoke.
43-
private let tokenType: TokenType
43+
let tokenType: TokenType
4444

4545
/// The token to be revoked.
46-
private let token: String
46+
let token: String
4747

4848
/// The ID Token associated with this credential.
4949
private let idToken: String

FirebaseAuth/Sources/Swift/Backend/RPC/SetAccountInfoRequest.swift

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class SetAccountInfoRequest: IdentityToolkitRequest, AuthRPCRequest {
8989
var displayName: String?
9090

9191
/// The local ID of the user.
92-
private let localID: String? = nil
92+
var localID: String? = nil
9393

9494
/// The email of the user.
9595
var email: String? = nil
@@ -101,37 +101,38 @@ class SetAccountInfoRequest: IdentityToolkitRequest, AuthRPCRequest {
101101
var password: String? = nil
102102

103103
/// The associated identity providers of the user.
104-
private let providers: [String]? = nil
104+
var providers: [String]? = nil
105105

106106
/// The out-of-band code of the change email request.
107107
var oobCode: String?
108108

109109
/// Whether to mark the email as verified or not.
110-
private let emailVerified: Bool = false
110+
var emailVerified: Bool = false
111111

112112
/// Whether to mark the user to upgrade to federated login.
113-
private let upgradeToFederatedLogin: Bool = false
113+
var upgradeToFederatedLogin: Bool = false
114114

115115
/// The captcha challenge.
116-
private let captchaChallenge: String? = nil
116+
var captchaChallenge: String? = nil
117117

118118
/// Response to the captcha.
119-
private let captchaResponse: String? = nil
119+
var captchaResponse: String? = nil
120120

121121
/// The list of user attributes to delete.
122122
///
123123
/// Every element of the list must be one of the predefined constant starts with
124124
/// `SetAccountInfoUserAttribute`.
125-
private let deleteAttributes: [String]? = nil
125+
var deleteAttributes: [String]? = nil
126126

127127
/// The list of identity providers to delete.
128128
var deleteProviders: [String]?
129129

130130
/// Whether the response should return access token and refresh token directly.
131131
/// The default value is `true` .
132-
private let returnSecureToken: Bool = true
132+
var returnSecureToken: Bool = true
133133

134-
init(requestConfiguration: AuthRequestConfiguration) {
134+
init(accessToken: String? = nil, requestConfiguration: AuthRequestConfiguration) {
135+
self.accessToken = accessToken
135136
super.init(endpoint: kSetAccountInfoEndpoint, requestConfiguration: requestConfiguration)
136137
}
137138

FirebaseAuth/Sources/Swift/User/UserProfileUpdate.swift

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ actor UserProfileUpdate {
4949

5050
func unlink(user: User, fromProvider provider: String) async throws -> User {
5151
let accessToken = try await user.internalGetTokenAsync()
52-
let request = SetAccountInfoRequest(requestConfiguration: user.requestConfiguration)
53-
request.accessToken = accessToken
52+
let request = SetAccountInfoRequest(
53+
accessToken: accessToken, requestConfiguration: user.requestConfiguration
54+
)
5455

5556
if user.providerDataRaw[provider] == nil {
5657
throw AuthErrorUtils.noSuchProviderError()
@@ -108,8 +109,10 @@ actor UserProfileUpdate {
108109

109110
// Mutate setAccountInfoRequest in block
110111
let setAccountInfoRequest =
111-
SetAccountInfoRequest(requestConfiguration: user.requestConfiguration)
112-
setAccountInfoRequest.accessToken = accessToken
112+
SetAccountInfoRequest(
113+
accessToken: accessToken,
114+
requestConfiguration: user.requestConfiguration
115+
)
113116
changeBlock(userAccountInfo, setAccountInfoRequest)
114117
do {
115118
let accountInfoResponse = try await AuthBackend.call(with: setAccountInfoRequest)

FirebaseAuth/Tests/Unit/SetAccountInfoTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,6 @@ class SetAccountInfoTests: RPCBaseTests {
221221
}
222222

223223
private func setAccountInfoRequest() -> SetAccountInfoRequest {
224-
return SetAccountInfoRequest(requestConfiguration: makeRequestConfiguration())
224+
return SetAccountInfoRequest(accessToken: nil, requestConfiguration: makeRequestConfiguration())
225225
}
226226
}

0 commit comments

Comments
 (0)