updatePhoneSession method
- @Deprecated('This API has been deprecated since 1.6.0. Please use `Account.createSession` instead.')
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
@Deprecated(
'This API has been deprecated since 1.6.0. Please use `Account.createSession` instead.',
)
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 = {
'X-Appwrite-Project': client.config['project'] ?? '',
'content-type': 'application/json',
'accept': 'application/json',
};
final res = await client.call(
HttpMethod.put,
path: apiPath,
params: apiParams,
headers: apiHeaders,
);
return models.Session.fromMap(res.data);
}