Nextcloud login flow v2 support (not in working state yet)

This commit is contained in:
Vicnet
2023-09-19 12:04:59 +02:00
parent 154cd9a51f
commit 0f16b164d6
6 changed files with 233 additions and 49 deletions

View File

@@ -21,7 +21,7 @@ enum AcceptHeader: String {
struct RequestWrapper {
let method: RequestMethod
let path: String
var path: String
let accept: AcceptHeader
let body: Codable?
@@ -31,6 +31,24 @@ struct RequestWrapper {
self.body = body
self.accept = accept
}
func prepend(cookBookPath: String) -> String {
return cookBookPath + self.path
}
}
struct LoginV2Request: Codable {
let poll: LoginV2Poll
let login: String
}
struct LoginV2Poll: Codable {
let token: String
let endpoint: String
}
struct LoginV2Response: Codable {
let server: String
let loginName: String
let appPassword: String
}