cacheUser method

Future<void> cacheUser(
  1. Authenticatable user
)

Cache user data to Vault.

Implementation

Future<void> cacheUser(Authenticatable user) async {
  try {
    final data = user.toMap();
    await Vault.put(userCacheKey, jsonEncode(data));
  } catch (e) {
    Log.warning('Auth: Failed to cache user: $e');
  }
}