Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/runlevel5/basic_rails_auth_demo
An example how to properly implement Rails basic auhentication
https://github.com/runlevel5/basic_rails_auth_demo
Last synced: about 8 hours ago
JSON representation
An example how to properly implement Rails basic auhentication
- Host: GitHub
- URL: https://github.com/runlevel5/basic_rails_auth_demo
- Owner: runlevel5
- Created: 2014-03-23T19:37:29.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-04-11T01:13:08.000Z (almost 11 years ago)
- Last Synced: 2024-11-25T17:13:15.928Z (2 months ago)
- Language: Ruby
- Size: 156 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rails Basic Auth demo
Devise or any Warden-based solutions are widely-used but
unattractive for its complexity.I am going to show you how to implement a very basic auth
for Rails with BCrypt.Please be noted that my code does not contain any ActiveRecord
callbacks and I also heavily use DCI Service Object pattern.## Setup
1. Bootstrap DB
```ruby
rake db:create db:migrate
```2. Create new user under `rails console`
```ruby
UserCreation.create(email: 'your_email', password: 'pass', password_confirmation: 'pass')
```3. Run server `rails server`
4. You can test the login
## Testing
```ruby
RAILS_ENV=tes rake db:schema:load
bundle exec rake spec
```## Author
Trung Lê
## License
MIT