fix product edit
This commit is contained in:
parent
1e02deb1b1
commit
a889b48bd1
@ -189,7 +189,6 @@ object Auth {
|
|||||||
this.expiresAt = LocalDateTime.now().plusSeconds(atResponse.expiresIn.toLong())
|
this.expiresAt = LocalDateTime.now().plusSeconds(atResponse.expiresIn.toLong())
|
||||||
this.refreshToken = atResponse.refreshToken
|
this.refreshToken = atResponse.refreshToken
|
||||||
this.refreshExpiresAt = LocalDateTime.now().plusSeconds(atResponse.refreshExpiresIn.toLong())
|
this.refreshExpiresAt = LocalDateTime.now().plusSeconds(atResponse.refreshExpiresIn.toLong())
|
||||||
this.refreshHistory = arrayListOf()
|
|
||||||
})
|
})
|
||||||
ctx.result(atResponse.accessToken).contentType(ContentType.TEXT_PLAIN)
|
ctx.result(atResponse.accessToken).contentType(ContentType.TEXT_PLAIN)
|
||||||
}
|
}
|
||||||
@ -273,15 +272,7 @@ object Auth {
|
|||||||
foundOldAt.expiresAt = LocalDateTime.now().plusSeconds(atResponse.expiresIn.toLong())
|
foundOldAt.expiresAt = LocalDateTime.now().plusSeconds(atResponse.expiresIn.toLong())
|
||||||
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 {
|
|
||||||
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)
|
database.update(foundOldAt)
|
||||||
|
|
||||||
ctx.result(atResponse.accessToken).contentType(ContentType.TEXT_PLAIN)
|
ctx.result(atResponse.accessToken).contentType(ContentType.TEXT_PLAIN)
|
||||||
|
|||||||
@ -709,6 +709,4 @@ open class AuthTokenCache : BaseModel() {
|
|||||||
var expired: Boolean = false
|
var expired: Boolean = false
|
||||||
var loggedOut: Boolean = false
|
var loggedOut: Boolean = false
|
||||||
|
|
||||||
@DbJsonB
|
|
||||||
var refreshHistory: MutableList<RefreshHistory>? = arrayListOf()
|
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user