authenticateUser method

void authenticateUser(
  1. String token,
  2. T user
)

Authenticates the user by setting the JWT token and logged-in user data.

This function takes a JWT token and a map representing user data and stores them in the CoffeeStorage for authentication and user tracking.

  • token: The JWT token to be stored.
  • user: A map containing user data.

Implementation

void authenticateUser(String token, T user) {
  CoffeeStorage.setJwtToken(token);
  CoffeeStorage.setLoggedUser(user);
  CoffeeStorage.clearAllCache().then((value) => null);
}