Update UserAuthResponse to a data class

Refactors UserAuthResponse to a data class for better
data handling and immutability.
This commit is contained in:
Hafiz 2025-07-02 11:59:28 -05:00
parent 28fc07d364
commit 8de67c8416

View file

@ -1,15 +1,12 @@
package com.habitrpg.common.habitica.models.auth
class UserAuthResponse {
// we need apiToken and token, as both are possible returns
var apiToken: String = ""
var token: String
get() {
return apiToken
}
set(value) {
apiToken = value
}
var newUser = false
var id: String = ""
data class UserAuthResponse(
val apiToken: String = "",
val id: String = "",
val newUser: Boolean = false
) {
val token: String
get() = apiToken
}