updateUser method

void updateUser(
  1. DescopeUser user
)

Updates the active session's user details.

This function accepts a DescopeUser value as a parameter which is returned by calls to Descope.auth.me. The manager will save the updated session to the storage.

final userResponse = await Descope.auth.me(session.refreshJwt);
Descope.sessionManager.updateUser(userResponse);

Implementation

void updateUser(DescopeUser user) {
  final session = _session;
  if (session != null) {
    session.updateUser(user);
    storage.saveSession(session);
    _notifyUser(session);
  }
}