mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 00:10:32 +05:30
Use Kotlinx Serialization with login.
This commit is contained in:
parent
0cf5853a3a
commit
f98123270e
@ -1,9 +1,9 @@
|
||||
package com.github.libretube.api.obj
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@Serializable
|
||||
data class Login(
|
||||
val username: String? = null,
|
||||
val password: String? = null
|
||||
val username: String,
|
||||
val password: String
|
||||
)
|
||||
|
@ -1,9 +1,9 @@
|
||||
package com.github.libretube.api.obj
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@Serializable
|
||||
data class Token(
|
||||
var token: String? = null,
|
||||
var error: String? = null
|
||||
val token: String? = null,
|
||||
val error: String? = null
|
||||
)
|
||||
|
@ -92,8 +92,8 @@ class LoginDialog : DialogFragment() {
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
|
||||
PreferenceHelper.setToken(response.token!!)
|
||||
PreferenceHelper.setUsername(login.username!!)
|
||||
PreferenceHelper.setToken(response.token)
|
||||
PreferenceHelper.setUsername(login.username)
|
||||
|
||||
dialog?.dismiss()
|
||||
activity?.recreate()
|
||||
|
Loading…
x
Reference in New Issue
Block a user