diff --git a/MatrixSDK/Contrib/Swift/JSONModels/MXJSONModels.swift b/MatrixSDK/Contrib/Swift/JSONModels/MXJSONModels.swift index 27654cdad4..76f368078a 100644 --- a/MatrixSDK/Contrib/Swift/JSONModels/MXJSONModels.swift +++ b/MatrixSDK/Contrib/Swift/JSONModels/MXJSONModels.swift @@ -21,6 +21,7 @@ import Foundation public enum MXLoginFlowType: Equatable, Hashable { case password case recaptcha + case registrationToken case OAuth2 case emailIdentity case msisdn @@ -33,6 +34,7 @@ public enum MXLoginFlowType: Equatable, Hashable { switch self { case .password: return kMXLoginFlowTypePassword case .recaptcha: return kMXLoginFlowTypeRecaptcha + case .registrationToken: return kMXLoginFlowTypeRegistrationToken case .OAuth2: return kMXLoginFlowTypeOAuth2 case .emailIdentity: return kMXLoginFlowTypeEmailIdentity case .msisdn: return kMXLoginFlowTypeMSISDN @@ -44,7 +46,7 @@ public enum MXLoginFlowType: Equatable, Hashable { } public init(identifier: String) { - let flowTypes: [MXLoginFlowType] = [.password, .recaptcha, .OAuth2, .emailIdentity, .msisdn, .token, .dummy, .emailCode] + let flowTypes: [MXLoginFlowType] = [.password, .recaptcha, .registrationToken, .OAuth2, .emailIdentity, .msisdn, .token, .dummy, .emailCode] self = flowTypes.first(where: { $0.identifier == identifier }) ?? .other(identifier) } } diff --git a/MatrixSDK/JSONModels/MXJSONModels.h b/MatrixSDK/JSONModels/MXJSONModels.h index 715faa2a9c..5232ecd2fc 100644 --- a/MatrixSDK/JSONModels/MXJSONModels.h +++ b/MatrixSDK/JSONModels/MXJSONModels.h @@ -137,6 +137,7 @@ FOUNDATION_EXPORT NSString *const kMX3PIDMediumMSISDN; typedef NSString* MXLoginFlowType NS_REFINED_FOR_SWIFT; FOUNDATION_EXPORT NSString *const kMXLoginFlowTypePassword; FOUNDATION_EXPORT NSString *const kMXLoginFlowTypeRecaptcha; +FOUNDATION_EXPORT NSString *const kMXLoginFlowTypeRegistrationToken; FOUNDATION_EXPORT NSString *const kMXLoginFlowTypeOAuth2; FOUNDATION_EXPORT NSString *const kMXLoginFlowTypeCAS; FOUNDATION_EXPORT NSString *const kMXLoginFlowTypeSSO; diff --git a/MatrixSDK/JSONModels/MXJSONModels.m b/MatrixSDK/JSONModels/MXJSONModels.m index 8b97ebd37e..be09d4f54d 100644 --- a/MatrixSDK/JSONModels/MXJSONModels.m +++ b/MatrixSDK/JSONModels/MXJSONModels.m @@ -122,6 +122,7 @@ + (id)modelFromJSON:(NSDictionary *)JSONDictionary NSString *const kMXLoginFlowTypePassword = @"m.login.password"; NSString *const kMXLoginFlowTypeRecaptcha = @"m.login.recaptcha"; +NSString *const kMXLoginFlowTypeRegistrationToken = @"m.login.registration_token"; NSString *const kMXLoginFlowTypeOAuth2 = @"m.login.oauth2"; NSString *const kMXLoginFlowTypeCAS = @"m.login.cas"; NSString *const kMXLoginFlowTypeSSO = @"m.login.sso"; diff --git a/changelog.d/6507.feature b/changelog.d/6507.feature new file mode 100644 index 0000000000..cc85338c61 --- /dev/null +++ b/changelog.d/6507.feature @@ -0,0 +1 @@ +Added types for MSC3231: registration tokens.