updatePhoneSession method

Future<Session> updatePhoneSession({
  1. required String userId,
  2. required String secret,
})

Update phone session

Use this endpoint to create a session from token. Provide the userId and secret parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.

Implementation

Future<models.Session> updatePhoneSession(
    {required String userId, required String secret}) async {
  final String apiPath = '/account/sessions/phone';

  final Map<String, dynamic> apiParams = {
    'userId': userId,
    'secret': secret,
  };

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

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

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