- Connect SettingsView font selection to WebView CSS rendering - Add dynamic font size and family mapping in WebView - Implement CSS custom properties for responsive font scaling - Add font family fallback stacks for cross-platform compatibility - Update WebView to use Settings object for typography configuration
31 lines
851 B
Swift
31 lines
851 B
Swift
import Foundation
|
|
|
|
class AuthRepository: PAuthRepository {
|
|
private let api: PAPI
|
|
private let settingsRepository: PSettingsRepository
|
|
|
|
init(api: PAPI, settingsRepository: PSettingsRepository) {
|
|
self.api = api
|
|
self.settingsRepository = settingsRepository
|
|
}
|
|
|
|
func login(username: String, password: String) async throws -> User {
|
|
let userDto = try await api.login(username: username, password: password)
|
|
// Token wird automatisch von der API gespeichert
|
|
return User(id: userDto.id, token: userDto.token)
|
|
}
|
|
|
|
func logout() async throws {
|
|
await api.tokenProvider.clearToken()
|
|
}
|
|
|
|
func getCurrentSettings() async throws -> Settings? {
|
|
return try await settingsRepository.loadSettings()
|
|
}
|
|
}
|
|
|
|
struct User {
|
|
let id: String
|
|
let token: String
|
|
}
|