电话号码验证

Hello Support,

I am trying to validate the phone number which user enters during registration. So I added few user fields to registration screen. So I make the user enter his phone number.
I also have added code in the themes JS section, which can send a OTP to user.

I have not been able to figure out the best way to take the phone number from profile and send an sms to it.
What I have tried:
Use a wizard after registration. It will run automatically.

  1. When it opens, I need the phone number of the profile. (I see that wizard can get default attributes like username u{username}, but not my custom field phonenumber u{phone})
  2. When I get the number (which I can make the user enter in a field again), how to call my JS code which I entered in the theme JS section.
    I have seen that when a normal page is loaded, api.onPageChange((url) => {
    This works. But when wizard gets loaded, this does not work.
    I tried using the document model,

if (‘Discourse’ in window) {
if (‘Discourse’ in window && typeof Discourse._registerPluginCode === ‘function’) {
Discourse._registerPluginCode
But register plugin fails.

So I am not sure, if I am on the right track or if there might be a simple way of taking the phone number and executing a custom JS code for sending sms.

Thanks,
Prashanth

1 个赞

I’m far from a maven on the Ember side, so perhaps you can do something there, but I doubt it. I think you’ll need a plugin.

2 个赞

抱歉,这里的目标是什么?要求注册时提供有效的电话号码?

1 个赞

您是使用 Custom Wizard Plugin 🧙 完成的吗?

我很想了解更多细节。

1 个赞

你是怎么做到的?我不确定我是否理解你所说的“使用正确的变量格式通过自定义字段传递它”是什么意思。

您建议的网站乍一看似乎不值得信赖。

关于公司信息为零。谁在运营?在哪个国家?
自动生成的隐私政策。未定义的占位符(页脚中的“© 0001”)……

根本不值得信赖。

1 个赞

他们还发布了帖子,当被问及问题时,他们没有回答,而是删除了第一个帖子,并重新发布了同一个帖子,附带了一个链接。

2 个赞