-
Notifications
You must be signed in to change notification settings - Fork 226
/
FxAccountConfig.swift
44 lines (39 loc) · 1.3 KB
/
FxAccountConfig.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
37
38
39
40
41
42
43
44
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import Foundation
open class FxAConfig {
public enum Server: String {
case release = "https://accounts.firefox.com"
case stable = "https://stable.dev.lcip.org"
case stage = "https://accounts.stage.mozaws.net"
case china = "https://accounts.firefox.com.cn"
case localdev = "http://127.0.0.1:3030"
}
let contentUrl: String
let clientId: String
let redirectUri: String
let tokenServerUrlOverride: String?
public init(
contentUrl: String,
clientId: String,
redirectUri: String,
tokenServerUrlOverride: String? = nil
) {
self.contentUrl = contentUrl
self.clientId = clientId
self.redirectUri = redirectUri
self.tokenServerUrlOverride = tokenServerUrlOverride
}
public init(
server: Server,
clientId: String,
redirectUri: String,
tokenServerUrlOverride: String? = nil
) {
contentUrl = server.rawValue
self.clientId = clientId
self.redirectUri = redirectUri
self.tokenServerUrlOverride = tokenServerUrlOverride
}
}