mirror of
https://github.com/bitwarden/android.git
synced 2026-08-28 14:47:37 -05:00
[PM-26736] Fix push notification logout reason serialization (#6116)
This commit is contained in:
+1
-1
@@ -57,7 +57,7 @@ sealed class NotificationPayload {
|
||||
@JsonNames("Date", "date")
|
||||
val date: ZonedDateTime?,
|
||||
|
||||
@JsonNames("PushNotificationLogOutReason", "pushNotificationLogOutReason")
|
||||
@JsonNames("Reason", "reason")
|
||||
val pushNotificationLogOutReason: PushNotificationLogOutReason?,
|
||||
) : NotificationPayload()
|
||||
|
||||
|
||||
+11
@@ -1,11 +1,22 @@
|
||||
package com.x8bit.bitwarden.data.platform.manager.model
|
||||
|
||||
import androidx.annotation.Keep
|
||||
import com.bitwarden.core.data.serializer.BaseEnumeratedIntSerializer
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
/**
|
||||
* Enumerated values to represent the possible reasons for a log out push notification
|
||||
*/
|
||||
@Serializable(with = PushNotificationLogOutReasonSerializer::class)
|
||||
enum class PushNotificationLogOutReason {
|
||||
@SerialName("0")
|
||||
KDF_CHANGE,
|
||||
}
|
||||
|
||||
@Keep
|
||||
private class PushNotificationLogOutReasonSerializer :
|
||||
BaseEnumeratedIntSerializer<PushNotificationLogOutReason>(
|
||||
className = "PushNotificationLogOutReason",
|
||||
values = PushNotificationLogOutReason.entries.toTypedArray(),
|
||||
)
|
||||
|
||||
@@ -975,7 +975,7 @@ private val LOGOUT_KDF_NOTIFICATION_MAP = mapOf(
|
||||
"payload" to """{
|
||||
"UserId": "078966a2-93c2-4618-ae2a-0a2394c88d37",
|
||||
"Date": "2023-10-27T12:00:00.000Z",
|
||||
"PushNotificationLogOutReason": "0"
|
||||
"Reason": 0
|
||||
}""",
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user