'PyOTP on AWS Lambda doesn't reproduce same OTP

I have python Flask application running on AWS lambda(serverless).

def generate_otp():
  totp = pyotp.TOTP('123456789abcdef', interval=180)
  otp = totp.now()
  print('Generated OTP {0}'.format(otp))


def verify_otp(rx_otp):
  totp = pyotp.TOTP('123456789abcdef')
  otp = totp.now()
  print('Verify OTP {0}'.format(otp))


Solution 1:[1]

async () => {} is a function declaration. So you assigned config to a function.

You have to call that function, and await the result, in order to get the value you want.

console.log(await config());

But are you sure you want a dynamic import here?

Because this should do the same thing without any headaches at all.

import { config } from "../test";

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1