2018-09-11 14:52:21 +00:00
|
|
|
//
|
|
|
|
// LoginSettings.swift
|
|
|
|
// Pachyderm
|
|
|
|
//
|
|
|
|
// Created by Shadowfacts on 9/9/18.
|
|
|
|
// Copyright © 2018 Shadowfacts. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
|
|
|
|
public class LoginSettings: Decodable {
|
|
|
|
public let accessToken: String
|
2020-10-26 03:07:41 +00:00
|
|
|
private let scope: String?
|
2018-09-11 14:52:21 +00:00
|
|
|
|
|
|
|
public var scopes: [Scope] {
|
2020-10-26 03:07:41 +00:00
|
|
|
guard let scope = scope else { return [] }
|
2018-09-11 14:52:21 +00:00
|
|
|
return scope.components(separatedBy: .whitespaces).compactMap(Scope.init)
|
|
|
|
}
|
|
|
|
|
|
|
|
private enum CodingKeys: String, CodingKey {
|
|
|
|
case accessToken = "access_token"
|
|
|
|
case scope
|
|
|
|
}
|
|
|
|
}
|