Skip to content

Commit

Permalink
Expose AuthenticationRestClient async login token generation method (…
Browse files Browse the repository at this point in the history
…MSC3882)
  • Loading branch information
stefanceriu committed Oct 7, 2022
1 parent 1ee8c9c commit 13be294
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Riot/Categories/MXRestClient+Async.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ extension MXRestClient {
return MXCredentials(loginResponse: loginResponse, andDefaultCredentials: credentials)
}

/// An async version of generateLoginToken(completion:)
func generateLoginToken() async throws -> MXLoginToken {
try await getResponse(generateLoginToken)
}

// MARK: - Registration

/// An async version of `getRegisterSession(completion:)`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ protocol AuthenticationRestClient: AnyObject {
func login(parameters: LoginParameters) async throws -> MXCredentials
func login(parameters: [String: Any]) async throws -> MXCredentials

func generateLoginToken() async throws -> MXLoginToken

// MARK: Registration

var registerFallbackURL: URL { get }
Expand Down

0 comments on commit 13be294

Please sign in to comment.