WIP - Complete App refactoring

This commit is contained in:
VincentMeilinger
2025-05-26 15:52:12 +02:00
parent c4be0e98b9
commit 29fd3c668b
19 changed files with 691 additions and 23 deletions

View File

@@ -0,0 +1,30 @@
//
// CookbookV1Account.swift
// Nextcloud Cookbook iOS Client
//
// Created by Vincent Meilinger on 24.01.25.
//
import Foundation
import KeychainSwift
struct CookbookAccount: Account {
let id: UUID
var displayName: String = "Nextcloud Cookbook Account"
let accountType: AccountType = .cookbook
let baseURL: URL
let username: String
/// Keychain convenience
func saveTokenToKeychain(_ token: String) {
let keychain = KeychainSwift()
keychain.set(token, forKey: "token-\(id.uuidString)")
}
func getTokenFromKeychain() -> String? {
let keychain = KeychainSwift()
return keychain.get("token-\(id.uuidString)")
}
}

View File

@@ -0,0 +1,8 @@
//
// LocalAccount.swift
// Nextcloud Cookbook iOS Client
//
// Created by Vincent Meilinger on 16.04.25.
//
import Foundation