createDeviceAuth method
creates a DeviceAuth
object.
a device auth is valid until its forcefully deleted or account password is changed.
Implementation
Future<DeviceAuth> createDeviceAuth() async {
dynamic res = await _client.send(
method: "POST",
url: "${Endpoints().oauthDeviceAuth}/${_client.accountId}/deviceAuth",
);
return DeviceAuth(
accountId: _client.accountId,
deviceId: res["deviceId"],
secret: res["secret"],
displayName: _client.displayName,
);
}