keep track of auth token in db

This commit is contained in:
gowthaman.b
2024-05-08 13:27:02 +05:30
parent 182ad004fb
commit ef181bce1a
4 changed files with 117 additions and 32 deletions

View File

@@ -9,7 +9,7 @@ import io.ebean.annotation.*
import io.ebean.annotation.Index
import java.time.LocalDate
import java.time.LocalDateTime
import java.util.UUID
import java.util.*
import javax.persistence.*
data class Comments(val text: String = "", val by: String = "", val at: LocalDateTime = LocalDateTime.now())
@@ -257,10 +257,12 @@ enum class AddressType {
}
data class ContactPerson(
val id : String = UUID.randomUUID().toString(),
val name: String = "", val email: String = "", val mobile: String = "")
val id: String = UUID.randomUUID().toString(),
val name: String = "", val email: String = "", val mobile: String = ""
)
data class Address(
val id : String = UUID.randomUUID().toString(),
val id: String = UUID.randomUUID().toString(),
val type: AddressType = AddressType.BILLING,
val address: String = "",
val pincode: String = ""
@@ -683,4 +685,19 @@ open class Plant : BaseModel() {
@DbJsonB
var prefixes: MutableMap<String, String>? = mutableMapOf()
}
@Entity
open class AuthTokenCache : BaseModel() {
@Column(columnDefinition = "text")
var authToken: String = ""
var issuedAt: LocalDateTime = LocalDateTime.now()
var expiresAt: LocalDateTime = LocalDateTime.now()
var refreshExpiresAt: LocalDateTime = LocalDateTime.now()
@Column(columnDefinition = "text")
var refreshToken: String = ""
var userId: String = ""
var expired: Boolean = false
var loggedOut: Boolean = false
}