The yorchauth gem allows you to configure a user authentication uing bcrypt and sendgrid as the default SMTP protocol.
If you want to build a user authentication rapidly and send email confirmations to any email account, the yorchauth gem will help you. It generates controllers (authenticate, users and sessions), mailers, model, views, routes and migrations.
Besides, it adds the Sendgrid Configuration in the config/development.rb file. You just need to create the env file and your API KYES from Sendgrid
Add the yorchauth gem in your Gemfile.
gem "yorchauth", github: 'Jorge-Ortiz-Mata/yorchauth-gem'
And then execute:
$ bundle install
You can see the help documentation by running the following command: rails g yorchauth --help
. It's not necessary to do it but it'll give you some information about how you can use this gem.
- Copy the ruby gem into your project, in the Gemfile and then run:
$ bundle install
- Generate the User Authentication using this command:
$ rails g yorchauth user
It generates controllers, models, views, migration, routes and a short configuration for Sendgrid in the config/environments/development.rb file.
- The Yorchauth gem uses two gems: bcrypt and dot-env. So you will need to install these gems. Run the next command:
$ bundle install
- Add your SENDGRID Keys into the .env file generated. For example:
- SENDGRID_EMAIL_VALID='myuser@email.com'
- SENDGRID_API_KEY='ALL_YOUR_API_KEY'
- Run the following command to create the users table:
$ rails db:migrate
- And finally, each controller you have will inherit from AuthenticateController.
class PagesController < AuthenticateController
def index; end
end
- Don't forget to add your API Keys into your .gitignore file and enjoy!
Feel free to contribute to this ruby gem. Make sure you have cloned this repository in your local computer. This repository has permissions, so you'll need to open a pull request each time you commit new changes.
The gem is available as open source under the terms of the MIT License.