getSession method
Implementation
Future<Session?> getSession({
required ApiClient apiClient,
bool forceRefresh = false,
}) async {
var session = _session;
if (session == null) {
return null;
}
if (!forceRefresh && !_hasExpired(session.expiresAt)) {
return session;
}
session = await apiClient.refreshToken(
sessionId: session.id,
refreshToken: session.refreshToken,
);
await _writeSession(session);
_session = session;
return session;
}