I’ve attempted a few things and made a PR to your plugin and the fix seems to be working.
https://github.com/mjsir911/discourse-telegram-auth/pull/1