Skip to content

Commit cf56853

Browse files
committed
fix(flipcash/auth): fix lookup result for temporary account created
Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
1 parent bd359e5 commit cf56853

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

apps/flipcash/shared/authentication/src/main/kotlin/com/flipcash/app/auth/internal/credentials/PassphraseCredentialManager.kt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,17 @@ class PassphraseCredentialManager @Inject constructor(
176176
return LookupResult.ExistingAccountFound(existingAccount)
177177
}
178178

179-
val temporaryAccount = storage.data.map { it[temporaryUserIdKey] }.firstOrNull()
179+
val temporaryAccount = storage.data.map { it[temporaryEntropyKey] }.firstOrNull()
180180
if (temporaryAccount != null) {
181-
val seenAccessKey = storage.data.map { it[seenAccessKeyKey(temporaryAccount)] }.firstOrNull() ?: false
182-
return LookupResult.TemporaryAccountCreated(temporaryAccount, seenAccessKey)
181+
val entropy = storage.data.map { it[temporaryEntropyKey] }.firstOrNull()
182+
if (entropy != null) {
183+
val seenAccessKey =
184+
storage.data.map { it[seenAccessKeyKey(temporaryAccount)] }.firstOrNull() ?: false
185+
return LookupResult.TemporaryAccountCreated(
186+
entropy = entropy,
187+
seenAccessKey = seenAccessKey
188+
)
189+
}
183190
}
184191

185192
return LookupResult.NoAccountFound

0 commit comments

Comments
 (0)