This is a proof-of-concept for authentication using Passwordless gem only that allows user-choice between: • Email • SMS
Step 1
Step 2
The user then logs in via 6-digit code ubiqutiously. To do this, several modifications to Passwordless's code needed to be made, including passwordless config.after_session_save as well the sessions_controller (I was oddly unable to monkeypatch here so I copied the whole sessions_controller file to achieve this.)
Users not already in the database are created on the fly, if they don't exist.
Node + Ruby versions are in .node-version and .ruby-version, respectively.
bin/setup
bin/dev
run with bin/rake
- credentials not included *
TWILIO_ACCOUNT_SID=
TWILIO_AUTH_TOKEN=
TWILIO_SENDER_NUMBER=
SENDGRID_SMTP_ADDRESS=smtp.sendgrid.net
SENDGRID_SMTP_PORT=587
SENDGRID_SMTP_PASSWORD=
DEFAULT_FROM_ADDRESS=support@domain.com
SENDGRID_SMTP_PASSWORD is also known as the API key which you get from the Sendgrid interface.
TWILIO_SENDER_NUMBER should begin with +1 and be a valid and approved sender number on your associated Twilio account.

