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

Helper function to generate the logout url for devices on MAS #1813

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, readonly) NSString *issuer;
@property (nonatomic, readonly, nullable) NSString *account;

-(NSURL * _Nullable) getMasLogoutDeviceURLFromDeviceID: (NSString * ) deviceID;
Velin92 marked this conversation as resolved.
Show resolved Hide resolved

@end

NS_ASSUME_NONNULL_END
17 changes: 17 additions & 0 deletions MatrixSDK/JSONModels/AutoDiscovery/MXWellKnownAuthentication.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,23 @@ + (instancetype)modelFromJSON:(NSDictionary *)JSONDictionary
return wellKnownAuthentication;
}

-(NSURL * _Nullable) getMasLogoutDeviceURLFromDeviceID: (NSString * ) deviceID
{
if (_account)
{
NSURLComponents *components = [NSURLComponents componentsWithString:_account];
components.queryItems = @[
[NSURLQueryItem queryItemWithName:@"device_id" value:deviceID],
[NSURLQueryItem queryItemWithName:@"action" value:@"session_end"]
];
return components.URL;
}
else
{
return nil;
Velin92 marked this conversation as resolved.
Show resolved Hide resolved
}
}


#pragma mark - NSCoding

Expand Down
1 change: 1 addition & 0 deletions changelog.d/pr-1813.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Function that allows to generate from the well known authentication, a logout mas URL given the device ID.
Loading