loginWithSessionId method

Future<AuthResponse> loginWithSessionId(
  1. Authenticatable user,
  2. String sessionId
)

Logs in user and stores in specific session

user The user to log in sessionId The session ID to store user in Returns authentication response

Implementation

Future<AuthResponse> loginWithSessionId(
  Authenticatable user,
  String sessionId,
) async {
  // Generate tokens using driver
  final authResponse = await driver.generateTokens(user);

  // Store user ID in session
  if (_sessionManager != null) {
    await _storeUserInSessionById(sessionId, user.getAuthIdentifier());
  }

  return authResponse;
}