mirror of
https://github.com/bitwarden/android.git
synced 2025-02-16 11:59:57 +03:00
Fix crash when parsing JWT and 'name' property is not present in the … (#146)
Co-authored-by: David Perez <david@livefront.com>
This commit is contained in:
parent
284cd9ab54
commit
4ebaec7970
1 changed files with 8 additions and 1 deletions
|
@ -2,12 +2,19 @@ package com.x8bit.bitwarden.data.auth.repository.util
|
||||||
|
|
||||||
import com.x8bit.bitwarden.data.auth.repository.model.JwtTokenDataJson
|
import com.x8bit.bitwarden.data.auth.repository.model.JwtTokenDataJson
|
||||||
import com.x8bit.bitwarden.data.platform.datasource.network.util.base64UrlDecodeOrNull
|
import com.x8bit.bitwarden.data.platform.datasource.network.util.base64UrlDecodeOrNull
|
||||||
|
import kotlinx.serialization.ExperimentalSerializationApi
|
||||||
import kotlinx.serialization.json.Json
|
import kotlinx.serialization.json.Json
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal, generally basic [Json] instance for JWT parsing purposes.
|
* Internal, generally basic [Json] instance for JWT parsing purposes.
|
||||||
*/
|
*/
|
||||||
private val json by lazy { Json { ignoreUnknownKeys = true } }
|
@OptIn(ExperimentalSerializationApi::class)
|
||||||
|
private val json: Json by lazy {
|
||||||
|
Json {
|
||||||
|
ignoreUnknownKeys = true
|
||||||
|
explicitNulls = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parses a [JwtTokenDataJson] from the given [jwtToken], or `null` if this parsing is not possible.
|
* Parses a [JwtTokenDataJson] from the given [jwtToken], or `null` if this parsing is not possible.
|
||||||
|
|
Loading…
Add table
Reference in a new issue