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.refreshToken = atResponse.refreshToken
|
||||
foundOldAt.refreshHistory = (foundOldAt.refreshHistory ?: arrayListOf()).apply {
|
||||
add(RefreshHistory(
|
||||
oldAt = authUser.token,
|
||||
oldExpiryAt = expiresAt.format(DateTimeFormatter.ISO_LOCAL_DATE_TIME),
|
||||
newAt = atResponse.accessToken,
|
||||
newExpiryAt = LocalDateTime.now().plusSeconds(atResponse.expiresIn.toLong()).format(DateTimeFormatter.ISO_LOCAL_DATE_TIME),
|
||||
createdAt = LocalDateTime.now().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME),
|
||||
))
|
||||
add(RefreshHistory().apply {
|
||||
oldAt = authUser.token
|
||||
oldExpiryAt = expiresAt.format(DateTimeFormatter.ISO_LOCAL_DATE_TIME)
|
||||
newAt = atResponse.accessToken
|
||||
newExpiryAt = LocalDateTime.now().plusSeconds(atResponse.expiresIn.toLong()).format(DateTimeFormatter.ISO_LOCAL_DATE_TIME)
|
||||
this.createdAt = LocalDateTime.now().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME)
|
||||
})
|
||||
}
|
||||
database.update(foundOldAt)
|
||||
|
||||
|
||||
@ -688,13 +688,13 @@ open class Plant : BaseModel() {
|
||||
var prefixes: MutableMap<String, String>? = mutableMapOf()
|
||||
}
|
||||
|
||||
data class RefreshHistory(
|
||||
val oldAt: String,
|
||||
val oldExpiryAt: String,
|
||||
val newAt: String,
|
||||
val newExpiryAt: String,
|
||||
val createdAt: String
|
||||
)
|
||||
class RefreshHistory {
|
||||
var oldAt: String = ""
|
||||
var oldExpiryAt: String = ""
|
||||
var newAt: String = ""
|
||||
var newExpiryAt: String = ""
|
||||
var createdAt: String = ""
|
||||
}
|
||||
@Entity
|
||||
open class AuthTokenCache : BaseModel() {
|
||||
@Column(columnDefinition = "text")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user