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
|
||||
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class Auth(
|
||||
val email: String,
|
||||
|
||||
@SerialName("authToken")
|
||||
val auth: String
|
||||
)
|
||||
|
||||
@@ -112,7 +112,10 @@ class AuthProvider @Inject constructor(
|
||||
suspend fun buildAnonymousAuthData(): Result<AuthData> {
|
||||
return withContext(Dispatchers.IO) {
|
||||
try {
|
||||
val playResponse = httpClient.getAuth(dispenserURL!!).also {
|
||||
val playResponse = httpClient.postAuth(
|
||||
dispenserURL!!,
|
||||
json.encodeToString(spoofProvider.deviceProperties).toByteArray()
|
||||
).also {
|
||||
if (!it.isSuccessful) throwError(it, context)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user