New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

devise_mobile_confirmable

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

devise_mobile_confirmable

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
2
Created
Source

devise_mobile_confirmable

Build Status Coverage Status

It adds support to devise for confirming users' mobile by SMS.

Installation

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

Requirements

devise
SMS Carrier

Usage

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

Configuration

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

License

The gem is available as open source under the terms of the MIT License.

Contact

The project's website is located at https://github.com/emn178/devise_mobile_confirmable
Author: Chen, Yi-Cyuan (emn178@gmail.com)

FAQs

Package last updated on 04 May 2016

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc