Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/Auth/Types.swift
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@
self.phone = phone
self.password = password
self.nonce = nonce
self.emailChangeToken = emailChangeToken

Check warning on line 508 in Sources/Auth/Types.swift

View workflow job for this annotation

GitHub Actions / xcodebuild (macOS legacy) (test, MAC_CATALYST, 15.4)

'emailChangeToken' is deprecated: This is an old field, stop relying on it.

Check warning on line 508 in Sources/Auth/Types.swift

View workflow job for this annotation

GitHub Actions / xcodebuild (macOS legacy) (test, MACOS, 15.4)

'emailChangeToken' is deprecated: This is an old field, stop relying on it.

Check warning on line 508 in Sources/Auth/Types.swift

View workflow job for this annotation

GitHub Actions / xcodebuild (macOS legacy) (test, IOS, 15.4)

'emailChangeToken' is deprecated: This is an old field, stop relying on it.

Check warning on line 508 in Sources/Auth/Types.swift

View workflow job for this annotation

GitHub Actions / xcodebuild (macOS latest) (MACOS, 26.2)

'emailChangeToken' is deprecated: This is an old field, stop relying on it.

Check warning on line 508 in Sources/Auth/Types.swift

View workflow job for this annotation

GitHub Actions / xcodebuild (macOS latest) (MACOS, 26.2)

'emailChangeToken' is deprecated: This is an old field, stop relying on it.

Check warning on line 508 in Sources/Auth/Types.swift

View workflow job for this annotation

GitHub Actions / xcodebuild (macOS latest) (IOS, 26.2)

'emailChangeToken' is deprecated: This is an old field, stop relying on it.

Check warning on line 508 in Sources/Auth/Types.swift

View workflow job for this annotation

GitHub Actions / xcodebuild (macOS latest) (IOS, 26.2)

'emailChangeToken' is deprecated: This is an old field, stop relying on it.

Check warning on line 508 in Sources/Auth/Types.swift

View workflow job for this annotation

GitHub Actions / xcodebuild (macOS latest) (IOS, 26.2)

'emailChangeToken' is deprecated: This is an old field, stop relying on it.

Check warning on line 508 in Sources/Auth/Types.swift

View workflow job for this annotation

GitHub Actions / xcodebuild (macOS latest) (IOS, 16.4)

'emailChangeToken' is deprecated: This is an old field, stop relying on it.

Check warning on line 508 in Sources/Auth/Types.swift

View workflow job for this annotation

GitHub Actions / xcodebuild (macOS latest) (IOS, 16.4)

'emailChangeToken' is deprecated: This is an old field, stop relying on it.

Check warning on line 508 in Sources/Auth/Types.swift

View workflow job for this annotation

GitHub Actions / xcodebuild (macOS latest) (test, IOS, 16.4)

'emailChangeToken' is deprecated: This is an old field, stop relying on it.
self.data = data
}
}
Expand Down Expand Up @@ -757,7 +757,7 @@

public struct AuthMFAUnenrollResponse: Decodable, Hashable, Sendable {
/// ID of the factor that was successfully unenrolled.
public let factorId: String
public let id: String
}

public struct AuthMFAListFactorsResponse: Decodable, Hashable, Sendable {
Expand Down
17 changes: 11 additions & 6 deletions Tests/AuthTests/AuthClientTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1804,8 +1804,8 @@ final class AuthClientTests: XCTestCase {
func testMFAUnenroll() async throws {
Mock(
url: clientURL.appendingPathComponent("factors/123"),
statusCode: 204,
data: [.delete: Data(#"{"factor_id":"123"}"#.utf8)]
statusCode: 200,
data: [.delete: Data(#"{"id":"123"}"#.utf8)]
)
.snapshotRequest {
#"""
Expand All @@ -1824,9 +1824,9 @@ final class AuthClientTests: XCTestCase {

Dependencies[sut.clientID].sessionStorage.store(.validSession)

let factorId = try await sut.mfa.unenroll(params: .init(factorId: "123")).factorId
let id = try await sut.mfa.unenroll(params: .init(factorId: "123")).id

expectNoDifference(factorId, "123")
expectNoDifference(id, "123")
}

func testMFAChallengeAndVerify() async throws {
Expand Down Expand Up @@ -2229,7 +2229,10 @@ final class AuthClientTests: XCTestCase {
XCTAssertNil(Dependencies[sut.clientID].sessionStorage.get())
}

func testRemoveSessionAndSignoutIfRefreshTokenNotFoundErrorReturned_withEmitLocalSessionAsInitialSession() async throws {
func
testRemoveSessionAndSignoutIfRefreshTokenNotFoundErrorReturned_withEmitLocalSessionAsInitialSession()
async throws
{
let sut = makeSUT(emitLocalSessionAsInitialSession: true)

Mock(
Expand Down Expand Up @@ -2676,7 +2679,9 @@ final class AuthClientTests: XCTestCase {
XCTAssertNotNil(result.claims.aud)
}

private func makeSUT(flowType: AuthFlowType = .pkce, emitLocalSessionAsInitialSession: Bool = false) -> AuthClient {
private func makeSUT(
flowType: AuthFlowType = .pkce, emitLocalSessionAsInitialSession: Bool = false
) -> AuthClient {
let sessionConfiguration = URLSessionConfiguration.default
sessionConfiguration.protocolClasses = [MockingURLProtocol.self]
let session = URLSession(configuration: sessionConfiguration)
Expand Down
Loading