updateSession method

Future<Session> updateSession({
  1. required String sessionId,
})

Update session

Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider.

Implementation

Future<models.Session> updateSession({required String sessionId}) async {
  final String apiPath =
      '/account/sessions/{sessionId}'.replaceAll('{sessionId}', sessionId);

  final Map<String, dynamic> apiParams = {};

  final Map<String, String> apiHeaders = {
    'content-type': 'application/json',
  };

  final res = await client.call(HttpMethod.patch,
      path: apiPath, params: apiParams, headers: apiHeaders);

  return models.Session.fromMap(res.data);
}