Skip to content

Commit

Permalink
Update FxaServer.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
Hakkı Kaan Çalışkan authored and ekager committed Jun 17, 2020
1 parent 670e03c commit 8cbdce5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions app/src/main/java/org/mozilla/fenix/components/FxaServer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@ import org.mozilla.fenix.ext.settings

object FxaServer {
private const val CLIENT_ID = "a2270f727f45f648"

const val REDIRECT_URL = "urn:ietf:wg:oauth:2.0:oob:oauth-redirect-webchannel"

fun config(context: Context): ServerConfig {
val serverOverride = context.settings().overrideFxAServer
val tokenServerOverride = context.settings().overrideSyncTokenServer.ifEmpty { null }
if (serverOverride.isEmpty()) {
return ServerConfig(Server.RELEASE, CLIENT_ID, redirectUrl(), tokenServerOverride)
return ServerConfig(Server.RELEASE, CLIENT_ID, REDIRECT_URL, tokenServerOverride)
}
return ServerConfig(serverOverride, CLIENT_ID, redirectUrl(), tokenServerOverride)
return ServerConfig(serverOverride, CLIENT_ID, REDIRECT_URL, tokenServerOverride)
}
}
2 changes: 1 addition & 1 deletion app/src/main/java/org/mozilla/fenix/components/Services.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Services(
private val accountManager: FxaAccountManager
) {
val accountsAuthFeature by lazy {
FirefoxAccountsAuthFeature(accountManager, FxaServer.redirectUrl()) { context, authUrl ->
FirefoxAccountsAuthFeature(accountManager, FxaServer.REDIRECT_URL) { context, authUrl ->
CoroutineScope(Dispatchers.Main).launch {
val intent = SupportUtils.createAuthCustomTabIntent(context, authUrl)
context.startActivity(intent)
Expand Down

0 comments on commit 8cbdce5

Please sign in to comment.