1
0
Fork 0
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:
Konstantin Ivanov 2024-07-10 15:54:35 +02:00 committed by konstantiniiv
parent fa4bdf1bed
commit 136cbf3ed1
9 changed files with 84 additions and 9 deletions

View file

@ -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
}
}