Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add registration token flow type #1890

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
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
4 changes: 3 additions & 1 deletion MatrixSDK/Contrib/Swift/JSONModels/MXJSONModels.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import Foundation
public enum MXLoginFlowType: Equatable, Hashable {
case password
case recaptcha
case registrationToken
case OAuth2
case emailIdentity
case msisdn
Expand All @@ -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
Expand All @@ -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)
}
}
Expand Down
1 change: 1 addition & 0 deletions MatrixSDK/JSONModels/MXJSONModels.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions MatrixSDK/JSONModels/MXJSONModels.m
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
1 change: 1 addition & 0 deletions changelog.d/6507.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added types for MSC3231: registration tokens.