mirror of
https://github.com/anyproto/anytype-kotlin.git
synced 2025-06-08 05:47:05 +09:00
DROID-2660 Login | Tech | Seed phrase check (#1385)
This commit is contained in:
parent
fa4bdf1bed
commit
136cbf3ed1
9 changed files with 84 additions and 9 deletions
|
@ -55,7 +55,7 @@ class DefaultAuthCache(
|
|||
/**
|
||||
* N.B. Migrating sensitive data from default to encrypted prefs.
|
||||
*/
|
||||
override suspend fun getMnemonic(): String {
|
||||
override suspend fun getMnemonic(): String? {
|
||||
val nonEncryptedMnemonic = defaultPrefs.getString(MNEMONIC_KEY, null)
|
||||
return if (nonEncryptedMnemonic != null) {
|
||||
encryptedPrefs.edit().putString(MNEMONIC_KEY, nonEncryptedMnemonic).apply()
|
||||
|
@ -63,7 +63,7 @@ class DefaultAuthCache(
|
|||
nonEncryptedMnemonic
|
||||
} else {
|
||||
val encryptedMnemonic = encryptedPrefs.getString(MNEMONIC_KEY, null)
|
||||
encryptedMnemonic ?: throw IllegalStateException("Recovery phrase is missing")
|
||||
encryptedMnemonic
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue