Coder Social home page Coder Social logo

rails-auth's Introduction

Rails Auth

Objectives
Implement a User model that securely stores passwords.
Build routes, controllers, and views necessary for a typical user flow.
Add a current_user application-level helper method to keep track of the currently signed in user.

Devise

I get it, some of you have heard of Devise. That's cool and all but they recommend that if you're new to rails:

If you are building your first Rails application, we recommend you do not use Devise. Devise requires a good understanding of the Rails Framework. In such cases, we advise you to start a simple authentication system from scratch. ... [docs]

Auth in Rails

In order to "roll our own" authentication we're going to follow this tutorial.

Don't copy/paste the tutorial, this is the most important part and to avoid copy-pasta we're going to change some core pieces.

Requirements

  1. Your rails app can't be named "gif_vault".
  2. Your rails app must not include any routes related to "gifs".
  3. You must be able to explain these terms:
  • `bcrypt`

    The bcrypt function is the default password hash algorithm for BSD and other systems ... [wiki]

    A method of doing one-way hashes of passwords.

  • CSRF Token

    Synchronizer token pattern is a technique where a token, secret and unique value for each request, is embedded by the web application in all HTML forms and verified on the server side. The token may be generated by any method that ensures unpredictability and uniqueness ... [wiki]

  • has_secure_password

Challenges

  1. Don't let an authenticated user signup or login a second time.
  2. Implement password_confirmation for new users.
  3. Create the ability to "remember me" for users logging in.
  • How long do you remember them for?
  1. Add ability to reset a password.
  2. Instead of a separate login view, give your site a navbar and add the login form to the nav.
  3. Support 3rd-party authentication on your own.
  • Could be github auth.

Docs & Resources

rails-auth's People

Contributors

justincastilla avatar

Watchers

James Cloos avatar Paolo Sese avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.