
Security News
Nx npm Packages Compromised in Supply Chain Attack Weaponizing AI CLI Tools
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
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
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.