forked from MastodonKit/MastodonKit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
LoginSettings.swift
36 lines (33 loc) · 977 Bytes
/
LoginSettings.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//
// LoginSettings.swift
// MastodonKit
//
// Created by Ornithologist Coder on 4/18/17.
// Copyright © 2017 MastodonKit. All rights reserved.
//
import Foundation
public class LoginSettings: Codable {
/// The user's access token.
public let accessToken: String
/// Access token type.
public let accessTokenType: String
/// The refresh token.
public let refreshToken: String?
/// Date when the access token was retrieved.
// public let createdAt: TimeInterval
/// Access scope.
private let scope: String
/// Access scopes.
public var scopes: [AccessScope] {
return scope
.components(separatedBy: .whitespaces)
.compactMap(toAccessScope)
}
private enum CodingKeys: String, CodingKey {
case accessToken = "access_token"
case accessTokenType = "token_type"
case refreshToken = "refresh_token"
case scope
// case createdAt = "created_at"
}
}