Files
element-x-ios/ElementX/Sources/Services/Authentication/AuthenticationServiceProxyProtocol.swift
T
Doug 1878a16496 #40: Use the Rust AuthenticationService.
* Update SDK package to 1.0.12-alpha.
* Use an app group for storage and stop stripping the http from the homeserver when configuring the service.
* Rename access token to restore token.
* Remove matrix.org server description inline with latest FTUE changes.
2022-07-27 10:57:16 +01:00

28 lines
819 B
Swift

//
// AuthenticationServiceProxyProtocol.swift
// ElementX
//
// Created by Doug on 29/06/2022.
// Copyright © 2022 Element. All rights reserved.
//
import Foundation
enum AuthenticationServiceError: Error {
case invalidServer
case invalidCredentials
case invalidHomeserverAddress
case accountDeactivated
case failedLoggingIn
}
@MainActor
protocol AuthenticationServiceProxyProtocol {
var homeserver: LoginHomeserver { get }
/// Sets up the service for login on the specified homeserver address.
func configure(for homeserverAddress: String) async -> Result<Void, AuthenticationServiceError>
/// Performs a password login using the current homeserver.
func login(username: String, password: String) async -> Result<UserSessionProtocol, AuthenticationServiceError>
}