Commit 2a5a0a18 authored by Ghitha Dinan's avatar Ghitha Dinan

user fixing

parent cd0fcace
......@@ -47,6 +47,10 @@ data class Users(
@JsonIgnore
var confirmedDate: Date? = null,
@Column(name = "logged_in")
@JsonIgnore
var loggedIn: Boolean? = false,
@Column(name = "created_at")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "dd-MM-yyyy HH:mm:ss", timezone = "GMT+7")
var createdAt: Date? = Date(),
......@@ -55,6 +59,9 @@ data class Users(
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "dd-MM-yyyy HH:mm:ss", timezone = "GMT+7")
var updatedAt: Date? = Date(),
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "dd-MM-yyyy HH:mm:ss", timezone = "GMT+7")
var lastLogin: Date? = Date(),
@Column(name = "active")
@JsonIgnore
var active: Boolean? = true
......
package id.co.sangkuriang.inovasi.daerah.master.utility
import com.fasterxml.jackson.databind.DeserializationFeature
import com.fasterxml.jackson.databind.ObjectMapper
import id.co.sangkuriang.inovasi.daerah.master.constant.UPLOAD_ICON_APPLICATION_CATEGORY_DIR
import id.co.sangkuriang.inovasi.daerah.master.constant.UPLOAD_IMAGE_APPLICATION_CATEGORY_DIR
......@@ -19,7 +20,9 @@ import javax.servlet.http.HttpServletRequest
fun getUsersLogin(): Users? {
return try {
val principal = SecurityContextHolder.getContext().authentication.principal as Any
ObjectMapper().readValue(principal.toString(), Users::class.java)
val objectMapper = ObjectMapper()
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
objectMapper.readValue(principal.toString(), Users::class.java)
} catch (e: Exception) {
null
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment