florianheinemann / passwordless

node.js/express module to authenticate users without password
MIT License
1.95k stars 129 forks source link

Purpose of Stateless / AngularJS Example #70

Open salva5234 opened 8 years ago

salva5234 commented 8 years ago

Hello Florian,

first of all, thank you for your great middleware.

I want to create a Rest API Server with Express und use your middleware (sms two-way authentication) for registration and authentication. I want to store the users in MongoDB after registration and tokenverification.

My first question is how to realize this scenario.

Therefore I´ve taken a look at the Stateless / AngularJS Example.

But I don´t understand the way passwordless is used in this example.

From the Dashboard you make a call to the route post.('/passwordless') passing the email address of the user. Then the requestToken-method is called and finally the delivery-mechanism logs an address to authenticate the user, like http://localhost:3000/#/authenticate?token=xyz&uid123.

In the next step I call the authentication page. Submitting the page, makes an api call to the route post('/login') passing ONLY the user id and the acceptToken method accepts the request generating a jwt-token, which has nothing to do with passwordless.

My questions are:

  1. Why does the acceptToken-Method accept requests without sending a valid passwordless token ?
  2. For what is the route post.('/passwordless') used in this example ? The only purpose seems to be to get the uid out of the sended email-Address.
  3. In general, sure that this is an appropiate example for using passwordless?

Thank you a lot in advance

cybercoder commented 8 years ago

Hello and thanks for great middleware But as mentioned i couldn't understand how can create a IONIC or Angular mechanism which register users by phone number and send them confirmation code and etc like Telegram.me APP, can you show a tutorial link which implemented this scenario?

Regards