AuthProvider: Use actual device properties to generate anonymous auth
Applying 3b41525c50 again but with changes for
kotlinx.serialization
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
@@ -19,10 +19,13 @@
|
|||||||
|
|
||||||
package com.aurora.store.data.model
|
package com.aurora.store.data.model
|
||||||
|
|
||||||
|
import kotlinx.serialization.SerialName
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class Auth(
|
data class Auth(
|
||||||
val email: String,
|
val email: String,
|
||||||
|
|
||||||
|
@SerialName("authToken")
|
||||||
val auth: String
|
val auth: String
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -112,7 +112,10 @@ class AuthProvider @Inject constructor(
|
|||||||
suspend fun buildAnonymousAuthData(): Result<AuthData> {
|
suspend fun buildAnonymousAuthData(): Result<AuthData> {
|
||||||
return withContext(Dispatchers.IO) {
|
return withContext(Dispatchers.IO) {
|
||||||
try {
|
try {
|
||||||
val playResponse = httpClient.getAuth(dispenserURL!!).also {
|
val playResponse = httpClient.postAuth(
|
||||||
|
dispenserURL!!,
|
||||||
|
json.encodeToString(spoofProvider.deviceProperties).toByteArray()
|
||||||
|
).also {
|
||||||
if (!it.isSuccessful) throwError(it, context)
|
if (!it.isSuccessful) throwError(it, context)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user