fix product edit
This commit is contained in:
parent
7d99a11e14
commit
1e02deb1b1
@ -274,13 +274,13 @@ object Auth {
|
|||||||
foundOldAt.refreshExpiresAt = LocalDateTime.now().plusSeconds(atResponse.refreshExpiresIn.toLong())
|
foundOldAt.refreshExpiresAt = LocalDateTime.now().plusSeconds(atResponse.refreshExpiresIn.toLong())
|
||||||
foundOldAt.refreshToken = atResponse.refreshToken
|
foundOldAt.refreshToken = atResponse.refreshToken
|
||||||
foundOldAt.refreshHistory = (foundOldAt.refreshHistory ?: arrayListOf()).apply {
|
foundOldAt.refreshHistory = (foundOldAt.refreshHistory ?: arrayListOf()).apply {
|
||||||
add(RefreshHistory(
|
add(RefreshHistory().apply {
|
||||||
oldAt = authUser.token,
|
oldAt = authUser.token
|
||||||
oldExpiryAt = expiresAt.format(DateTimeFormatter.ISO_LOCAL_DATE_TIME),
|
oldExpiryAt = expiresAt.format(DateTimeFormatter.ISO_LOCAL_DATE_TIME)
|
||||||
newAt = atResponse.accessToken,
|
newAt = atResponse.accessToken
|
||||||
newExpiryAt = LocalDateTime.now().plusSeconds(atResponse.expiresIn.toLong()).format(DateTimeFormatter.ISO_LOCAL_DATE_TIME),
|
newExpiryAt = LocalDateTime.now().plusSeconds(atResponse.expiresIn.toLong()).format(DateTimeFormatter.ISO_LOCAL_DATE_TIME)
|
||||||
createdAt = LocalDateTime.now().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME),
|
this.createdAt = LocalDateTime.now().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME)
|
||||||
))
|
})
|
||||||
}
|
}
|
||||||
database.update(foundOldAt)
|
database.update(foundOldAt)
|
||||||
|
|
||||||
|
|||||||
@ -688,13 +688,13 @@ open class Plant : BaseModel() {
|
|||||||
var prefixes: MutableMap<String, String>? = mutableMapOf()
|
var prefixes: MutableMap<String, String>? = mutableMapOf()
|
||||||
}
|
}
|
||||||
|
|
||||||
data class RefreshHistory(
|
class RefreshHistory {
|
||||||
val oldAt: String,
|
var oldAt: String = ""
|
||||||
val oldExpiryAt: String,
|
var oldExpiryAt: String = ""
|
||||||
val newAt: String,
|
var newAt: String = ""
|
||||||
val newExpiryAt: String,
|
var newExpiryAt: String = ""
|
||||||
val createdAt: String
|
var createdAt: String = ""
|
||||||
)
|
}
|
||||||
@Entity
|
@Entity
|
||||||
open class AuthTokenCache : BaseModel() {
|
open class AuthTokenCache : BaseModel() {
|
||||||
@Column(columnDefinition = "text")
|
@Column(columnDefinition = "text")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user