loginWithCode method
Login with feedback code and return tokens
code - The feedback code from device feedback API
deviceId - The device ID used for the feedback API call
Implementation
@override
Future<AuthTokens> loginWithCode(
String code, {
required String deviceId,
}) async {
final response = await remoteDataSource.loginWithCode(code);
if (response.data == null) {
throw Exception('Login failed: No data received');
}
final tokens = response.toAuthTokens(deviceId: deviceId);
if (tokens == null) {
throw Exception('Login failed: Invalid token data');
}
return tokens;
}