mirror of
https://github.com/metabolist/metatext.git
synced 2024-11-25 17:50:59 +00:00
21 lines
559 B
Swift
21 lines
559 B
Swift
// Copyright © 2020 Metabolist. All rights reserved.
|
|
|
|
import Foundation
|
|
import MastodonAPI
|
|
import Stubbing
|
|
|
|
extension AccessTokenEndpoint: Stubbing {
|
|
public func dataString(url: URL) -> String? {
|
|
switch self {
|
|
case let .oauthToken(_, _, _, _, scopes, _):
|
|
return """
|
|
{
|
|
"access_token": "ACCESS_TOKEN_STUB_VALUE",
|
|
"token_type": "Bearer",
|
|
"scope": "\(scopes)",
|
|
"created_at": "\(Int(Date().timeIntervalSince1970))"
|
|
}
|
|
"""
|
|
}
|
|
}
|
|
}
|