logout

suspend fun logout(): Result<Boolean>

Logs out the user and clears all authentication state.

This method clears:

  • Access and refresh tokens

  • Stored passkey credential ID (forces fallback to discoverable mode on next auth)

Call this when:

  • User explicitly logs out

  • Switching between accounts

  • After unrecoverable authentication errors

Note: This does NOT delete wallet data or backups. To fully clear all data, use debugClearHotStorage() instead.

Return

Result.success(true) if logout succeeded