Commit 23abecbe authored by Paul Bird's avatar Paul Bird

Tidy up url string concat

parent 0e7b90cf
......@@ -25,7 +25,12 @@ class Authenticate(context: Context) {
fun login(clientId: String, clientSecret: String, username: String, password: String) {
val postBody = "grant_type=password" + "&client_id=" + clientId + "&client_secret=" + clientSecret + "&scope=hubapi" + "&username=" + username + "&password=" + password
val postBody = "grant_type=password"
.plus( "&client_id=" + clientId)
.plus( "&client_secret=" + clientSecret)
.plus( "&scope=hubapi")
.plus( "&username=" + username )
.plus( "&password=" + password)
Log.d("postBody", postBody)
......@@ -39,8 +44,6 @@ class Authenticate(context: Context) {
fun refreshAccessToken(clientId: String, clientSecret: String, refreshToken: String) {
//val postBody = "grant_type=refresh_token" + "&client_id=" + clientId + "&client_secret=" + clientSecret + "&scope=hubapi" + "&refresh_token=" + refreshToken
val postBody = "grant_type=refresh_token"
.plus("&client_id=" + clientId)
.plus("&client_secret=" + clientSecret)
......@@ -98,7 +101,6 @@ class Authenticate(context: Context) {
internal fun saveTheTokens(accessToken: String, refreshToken: String) {
sharedPrefs.accessToken = accessToken
sharedPrefs.refreshToken = refreshToken
//sharedPrefs.setRefreshToken(refreshToken)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment