Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
devise_mobile_confirmable
Advanced tools
It adds support to devise for confirming users' mobile by SMS.
Add this line to your application's Gemfile:
gem 'devise_mobile_confirmable'
And then execute:
bundle
Or install it yourself as:
gem install devise_mobile_confirmable
Run the following generator to add DeviseMobileConfirmable's configuration option into the Devise configuration file (config/initializers/devise.rb):
rails g devise_mobile_confirmable:install
Add DeviseMobileConfirmable to your Devise models using the following generator:
rails g devise_mobile_confirmable MODEL
For example
rails g devise_mobile_confirmable user
And you can use following methods:
user.mobile_confirmed? # true if confirmed
user.change_mobile '+886987654321' # send SMS with token to user
user.confirm_mobile_token '123456' # user input the token and confirm his mobile phone
user.mobile # eg. '+886987654321'
# return how many seconds to enable next SMS request, equal or less than 0 will unlock
user.seconds_to_unlock_mobile_confirmation_token
You can overwrite token generating method, in model class:
def generate_mobile_confirmation_token
# return your token
end
You can set options in devise.rb
# ==> Configuration for :mobile_confirmable
# Specify mobile field in table.
# Default: :mobile
# config.mobile_field = :mobile
# Prevent too many requests for sending token by SMS.
# Default: 60.seconds
# config.throttle_mobile_confirmation_token = 60.seconds
# Expire token if too many retries. This is for preventing from brute force attack.
# Set to 0 to disable this feature.
# Default: 3
# config.max_mobile_confirmation_failure = 3
The gem is available as open source under the terms of the MIT License.
The project's website is located at https://github.com/emn178/devise_mobile_confirmable
Author: Chen, Yi-Cyuan (emn178@gmail.com)
FAQs
Unknown package
We found that devise_mobile_confirmable demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.