WIP - Complete App refactoring
This commit is contained in:
@@ -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)")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
//
|
||||
// LocalAccount.swift
|
||||
// Nextcloud Cookbook iOS Client
|
||||
//
|
||||
// Created by Vincent Meilinger on 16.04.25.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
Reference in New Issue
Block a user