mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-04-14 19:56:32 +00:00
Update UserAuthResponse to a data class
Refactors UserAuthResponse to a data class for better data handling and immutability.
This commit is contained in:
parent
28fc07d364
commit
8de67c8416
1 changed files with 9 additions and 12 deletions
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue