├── .DS_Store ├── .gitignore ├── Gemfile ├── Gemfile.lock ├── README.md ├── README.rdoc ├── Rakefile ├── app ├── .DS_Store ├── assets │ ├── images │ │ └── .keep │ ├── javascripts │ │ ├── application.js │ │ └── welcome.coffee │ └── stylesheets │ │ ├── application.scss │ │ └── welcome.scss ├── controllers │ ├── .DS_Store │ ├── api │ │ ├── password_resets_controller.rb │ │ ├── sessions_controller.rb │ │ └── users_controller.rb │ ├── application_controller.rb │ ├── concerns │ │ └── .keep │ ├── password_resets_controller.rb │ ├── sessions_controller.rb │ ├── users_controller.rb │ └── welcome_controller.rb ├── helpers │ ├── .DS_Store │ ├── application_helper.rb │ ├── password_resets_helper.rb │ ├── sessions_helper.rb │ └── welcome_helper.rb ├── mailers │ ├── .DS_Store │ ├── .keep │ ├── application_mailer.rb │ └── user_mailer.rb ├── models │ ├── .keep │ ├── concerns │ │ └── .keep │ └── user.rb └── views │ ├── .DS_Store │ ├── layouts │ └── application.html.erb │ ├── password_resets │ ├── edit.html.erb │ └── new.html.erb │ ├── sessions │ └── new.html.erb │ ├── shared │ └── _error_messages.html.erb │ ├── user_mailer │ ├── password_reset.html.erb │ └── password_reset.text.erb │ ├── users │ ├── _form.html.erb │ ├── edit.html.erb │ ├── index.html.erb │ ├── index.json.jbuilder │ ├── new.html.erb │ ├── show.html.erb │ └── show.json.jbuilder │ └── welcome │ └── welcome.html.erb ├── bin ├── bundle ├── rails ├── rake ├── setup └── spring ├── config.ru ├── config ├── application.rb ├── boot.rb ├── database.yml ├── environment.rb ├── environments │ ├── development.rb │ ├── production.rb │ └── test.rb ├── initializers │ ├── assets.rb │ ├── backtrace_silencers.rb │ ├── cookies_serializer.rb │ ├── filter_parameter_logging.rb │ ├── inflections.rb │ ├── mime_types.rb │ ├── session_store.rb │ └── wrap_parameters.rb ├── locales │ └── en.yml ├── routes.rb └── secrets.yml ├── db ├── migrate │ └── 20160315235724_create_users.rb ├── schema.rb └── seeds.rb ├── lib ├── assets │ └── .keep └── tasks │ └── .keep ├── log └── .keep ├── public ├── 404.html ├── 422.html ├── 500.html ├── favicon.ico └── robots.txt ├── test ├── controllers │ ├── .keep │ └── welcome_controller_test.rb ├── fixtures │ ├── .keep │ └── users.yml ├── helpers │ └── .keep ├── integration │ └── .keep ├── mailers │ └── .keep ├── models │ ├── .keep │ └── user_test.rb └── test_helper.rb └── vendor └── assets ├── javascripts └── .keep └── stylesheets └── .keep /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itzikbenh/Rails-React-Auth/631bfc9fa83a1c1a60c68bb0020fef1ca67f26d2/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files for more about ignoring files. 2 | # 3 | # If you find yourself ignoring temporary files generated by your text editor 4 | # or operating system, you probably want to add a global ignore instead: 5 | # git config --global core.excludesfile '~/.gitignore_global' 6 | 7 | # Ignore bundler config. 8 | /.bundle 9 | 10 | # Ignore all logfiles and tempfiles. 11 | /log/* 12 | !/log/.keep 13 | /tmp 14 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | 4 | # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 5 | gem 'rails', '4.2.5' 6 | # Use mysql as the database for Active Record 7 | gem 'mysql2', '>= 0.3.13', '< 0.5' 8 | # Use SCSS for stylesheets 9 | gem 'sass-rails', '~> 5.0' 10 | # Use Uglifier as compressor for JavaScript assets 11 | gem 'uglifier', '>= 1.3.0' 12 | # Use CoffeeScript for .coffee assets and views 13 | gem 'coffee-rails', '~> 4.1.0' 14 | # See https://github.com/rails/execjs#readme for more supported runtimes 15 | # gem 'therubyracer', platforms: :ruby 16 | 17 | # Use jquery as the JavaScript library 18 | gem 'jquery-rails' 19 | # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks 20 | gem 'turbolinks' 21 | # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 22 | gem 'jbuilder', '~> 2.0' 23 | # bundle exec rake doc:rails generates the API under doc/api. 24 | gem 'sdoc', '~> 0.4.0', group: :doc 25 | 26 | gem 'bcrypt', '~> 3.1.7' 27 | 28 | gem 'bootstrap-sass', '~> 3.3.6' 29 | 30 | gem 'rack-cors', :require => 'rack/cors' 31 | 32 | # Use ActiveModel has_secure_password 33 | # gem 'bcrypt', '~> 3.1.7' 34 | 35 | # Use Unicorn as the app server 36 | # gem 'unicorn' 37 | 38 | # Use Capistrano for deployment 39 | # gem 'capistrano-rails', group: :development 40 | 41 | group :development, :test do 42 | # Call 'byebug' anywhere in the code to stop execution and get a debugger console 43 | gem 'byebug' 44 | end 45 | 46 | group :production do 47 | gem 'pg', '0.17.1' 48 | gem 'rails_12factor', '0.0.2' 49 | end 50 | 51 | group :development do 52 | # Access an IRB console on exception pages or by using <%= console %> in views 53 | gem 'web-console', '~> 2.0' 54 | 55 | # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 56 | gem 'spring' 57 | end 58 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | actionmailer (4.2.5) 5 | actionpack (= 4.2.5) 6 | actionview (= 4.2.5) 7 | activejob (= 4.2.5) 8 | mail (~> 2.5, >= 2.5.4) 9 | rails-dom-testing (~> 1.0, >= 1.0.5) 10 | actionpack (4.2.5) 11 | actionview (= 4.2.5) 12 | activesupport (= 4.2.5) 13 | rack (~> 1.6) 14 | rack-test (~> 0.6.2) 15 | rails-dom-testing (~> 1.0, >= 1.0.5) 16 | rails-html-sanitizer (~> 1.0, >= 1.0.2) 17 | actionview (4.2.5) 18 | activesupport (= 4.2.5) 19 | builder (~> 3.1) 20 | erubis (~> 2.7.0) 21 | rails-dom-testing (~> 1.0, >= 1.0.5) 22 | rails-html-sanitizer (~> 1.0, >= 1.0.2) 23 | activejob (4.2.5) 24 | activesupport (= 4.2.5) 25 | globalid (>= 0.3.0) 26 | activemodel (4.2.5) 27 | activesupport (= 4.2.5) 28 | builder (~> 3.1) 29 | activerecord (4.2.5) 30 | activemodel (= 4.2.5) 31 | activesupport (= 4.2.5) 32 | arel (~> 6.0) 33 | activesupport (4.2.5) 34 | i18n (~> 0.7) 35 | json (~> 1.7, >= 1.7.7) 36 | minitest (~> 5.1) 37 | thread_safe (~> 0.3, >= 0.3.4) 38 | tzinfo (~> 1.1) 39 | arel (6.0.3) 40 | autoprefixer-rails (6.3.1) 41 | execjs 42 | json 43 | bcrypt (3.1.11) 44 | binding_of_caller (0.7.2) 45 | debug_inspector (>= 0.0.1) 46 | bootstrap-sass (3.3.6) 47 | autoprefixer-rails (>= 5.2.1) 48 | sass (>= 3.3.4) 49 | builder (3.2.2) 50 | byebug (8.2.2) 51 | coffee-rails (4.1.1) 52 | coffee-script (>= 2.2.0) 53 | railties (>= 4.0.0, < 5.1.x) 54 | coffee-script (2.4.1) 55 | coffee-script-source 56 | execjs 57 | coffee-script-source (1.10.0) 58 | concurrent-ruby (1.0.1) 59 | debug_inspector (0.0.2) 60 | erubis (2.7.0) 61 | execjs (2.6.0) 62 | globalid (0.3.6) 63 | activesupport (>= 4.1.0) 64 | i18n (0.7.0) 65 | jbuilder (2.4.1) 66 | activesupport (>= 3.0.0, < 5.1) 67 | multi_json (~> 1.2) 68 | jquery-rails (4.1.1) 69 | rails-dom-testing (>= 1, < 3) 70 | railties (>= 4.2.0) 71 | thor (>= 0.14, < 2.0) 72 | json (1.8.3) 73 | loofah (2.0.3) 74 | nokogiri (>= 1.5.9) 75 | mail (2.6.3) 76 | mime-types (>= 1.16, < 3) 77 | mime-types (2.99.1) 78 | mini_portile2 (2.0.0) 79 | minitest (5.8.4) 80 | multi_json (1.11.2) 81 | mysql2 (0.4.3) 82 | nokogiri (1.6.7.2) 83 | mini_portile2 (~> 2.0.0.rc2) 84 | pg (0.17.1) 85 | rack (1.6.4) 86 | rack-cors (0.4.0) 87 | rack-test (0.6.3) 88 | rack (>= 1.0) 89 | rails (4.2.5) 90 | actionmailer (= 4.2.5) 91 | actionpack (= 4.2.5) 92 | actionview (= 4.2.5) 93 | activejob (= 4.2.5) 94 | activemodel (= 4.2.5) 95 | activerecord (= 4.2.5) 96 | activesupport (= 4.2.5) 97 | bundler (>= 1.3.0, < 2.0) 98 | railties (= 4.2.5) 99 | sprockets-rails 100 | rails-deprecated_sanitizer (1.0.3) 101 | activesupport (>= 4.2.0.alpha) 102 | rails-dom-testing (1.0.7) 103 | activesupport (>= 4.2.0.beta, < 5.0) 104 | nokogiri (~> 1.6.0) 105 | rails-deprecated_sanitizer (>= 1.0.1) 106 | rails-html-sanitizer (1.0.3) 107 | loofah (~> 2.0) 108 | rails_12factor (0.0.2) 109 | rails_serve_static_assets 110 | rails_stdout_logging 111 | rails_serve_static_assets (0.0.5) 112 | rails_stdout_logging (0.0.5) 113 | railties (4.2.5) 114 | actionpack (= 4.2.5) 115 | activesupport (= 4.2.5) 116 | rake (>= 0.8.7) 117 | thor (>= 0.18.1, < 2.0) 118 | rake (11.1.1) 119 | rdoc (4.2.2) 120 | json (~> 1.4) 121 | sass (3.4.21) 122 | sass-rails (5.0.4) 123 | railties (>= 4.0.0, < 5.0) 124 | sass (~> 3.1) 125 | sprockets (>= 2.8, < 4.0) 126 | sprockets-rails (>= 2.0, < 4.0) 127 | tilt (>= 1.1, < 3) 128 | sdoc (0.4.1) 129 | json (~> 1.7, >= 1.7.7) 130 | rdoc (~> 4.0) 131 | spring (1.6.4) 132 | sprockets (3.5.2) 133 | concurrent-ruby (~> 1.0) 134 | rack (> 1, < 3) 135 | sprockets-rails (3.0.4) 136 | actionpack (>= 4.0) 137 | activesupport (>= 4.0) 138 | sprockets (>= 3.0.0) 139 | thor (0.19.1) 140 | thread_safe (0.3.5) 141 | tilt (2.0.2) 142 | turbolinks (2.5.3) 143 | coffee-rails 144 | tzinfo (1.2.2) 145 | thread_safe (~> 0.1) 146 | uglifier (2.7.2) 147 | execjs (>= 0.3.0) 148 | json (>= 1.8.0) 149 | web-console (2.3.0) 150 | activemodel (>= 4.0) 151 | binding_of_caller (>= 0.7.2) 152 | railties (>= 4.0) 153 | sprockets-rails (>= 2.0, < 4.0) 154 | 155 | PLATFORMS 156 | ruby 157 | 158 | DEPENDENCIES 159 | bcrypt (~> 3.1.7) 160 | bootstrap-sass (~> 3.3.6) 161 | byebug 162 | coffee-rails (~> 4.1.0) 163 | jbuilder (~> 2.0) 164 | jquery-rails 165 | mysql2 (>= 0.3.13, < 0.5) 166 | pg (= 0.17.1) 167 | rack-cors 168 | rails (= 4.2.5) 169 | rails_12factor (= 0.0.2) 170 | sass-rails (~> 5.0) 171 | sdoc (~> 0.4.0) 172 | spring 173 | turbolinks 174 | uglifier (>= 1.3.0) 175 | web-console (~> 2.0) 176 | 177 | BUNDLED WITH 178 | 1.11.2 179 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Rails-React-Auth 2 | 3 | This app is still in the work, but it has a complete Auth system that is ready to be used against client apps. 4 | Once you register from the client app you will receive an access_token. There is also a verify_access_token in the Session controller method so you can use it to verify the access_tokens. 5 | You may watch the first part of my tutorial where I explain how the Rails backend works in this link. https://www.youtube.com/watch?v=ZpiF5IhavaY 6 | 7 | # Setup 8 | 9 | 1. Clone the repository 10 | 2. Install required gems via `bundle install` 11 | 3. Update database credentials in `config/database.yml` 12 | 3. Setup database 13 | 1. `rake db:create` 14 | 2. `rake db:schema:load` 15 | 3. `rake db:migrate` 16 | 17 | # Development 18 | 19 | * Run project `rails server` 20 | * Navigate to `localhost:3000` to see it working! 21 | -------------------------------------------------------------------------------- /README.rdoc: -------------------------------------------------------------------------------- 1 | == README 2 | 3 | This README would normally document whatever steps are necessary to get the 4 | application up and running. 5 | 6 | Things you may want to cover: 7 | 8 | * Ruby version 9 | 10 | * System dependencies 11 | 12 | * Configuration 13 | 14 | * Database creation 15 | 16 | * Database initialization 17 | 18 | * How to run the test suite 19 | 20 | * Services (job queues, cache servers, search engines, etc.) 21 | 22 | * Deployment instructions 23 | 24 | * ... 25 | 26 | 27 | Please feel free to use a different markup language if you do not plan to run 28 | rake doc:app. 29 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require File.expand_path('../config/application', __FILE__) 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /app/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itzikbenh/Rails-React-Auth/631bfc9fa83a1c1a60c68bb0020fef1ca67f26d2/app/.DS_Store -------------------------------------------------------------------------------- /app/assets/images/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itzikbenh/Rails-React-Auth/631bfc9fa83a1c1a60c68bb0020fef1ca67f26d2/app/assets/images/.keep -------------------------------------------------------------------------------- /app/assets/javascripts/application.js: -------------------------------------------------------------------------------- 1 | // This is a manifest file that'll be compiled into application.js, which will include all the files 2 | // listed below. 3 | // 4 | // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, 5 | // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path. 6 | // 7 | // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the 8 | // compiled file. 9 | // 10 | // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details 11 | // about supported directives. 12 | // 13 | //= require jquery 14 | //= require bootstrap-sprockets 15 | //= require jquery_ujs 16 | //= require turbolinks 17 | //= require_tree . 18 | -------------------------------------------------------------------------------- /app/assets/javascripts/welcome.coffee: -------------------------------------------------------------------------------- 1 | # Place all the behaviors and hooks related to the matching controller here. 2 | # All this logic will automatically be available in application.js. 3 | # You can use CoffeeScript in this file: http://coffeescript.org/ 4 | -------------------------------------------------------------------------------- /app/assets/stylesheets/application.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a manifest file that'll be compiled into application.css, which will include all the files 3 | * listed below. 4 | * 5 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, 6 | * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path. 7 | * 8 | * You're free to add application-wide styles to this file and they'll appear at the bottom of the 9 | * compiled file so the styles you add here take precedence over styles defined in any styles 10 | * defined in the other CSS/SCSS files in this directory. It is generally better to create a new 11 | * file per style scope. 12 | * 13 | *= require_tree . 14 | *= require_self 15 | */ 16 | 17 | @import "bootstrap-sprockets"; 18 | @import "bootstrap"; 19 | 20 | body { 21 | padding-top: 50px; 22 | } 23 | 24 | .alert-success { 25 | width: 50%; 26 | margin: auto; 27 | text-align: center; 28 | box-shadow: 0px 0px 5px #888888; 29 | } 30 | 31 | .deleteAccount, .deleteAccount:visited, .deleteAccount:hover, .deleteAccount:focus { 32 | color: white; 33 | text-decoration: none; 34 | } 35 | -------------------------------------------------------------------------------- /app/assets/stylesheets/welcome.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the welcome controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: http://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /app/controllers/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itzikbenh/Rails-React-Auth/631bfc9fa83a1c1a60c68bb0020fef1ca67f26d2/app/controllers/.DS_Store -------------------------------------------------------------------------------- /app/controllers/api/password_resets_controller.rb: -------------------------------------------------------------------------------- 1 | class PasswordResetsController < ApplicationController 2 | before_action :get_user, only: [:edit, :update] 3 | before_action :valid_user, only: [:edit, :update] 4 | before_action :check_expiration, only: [:edit, :update] 5 | 6 | def new 7 | end 8 | 9 | def create 10 | @user = User.find_by(email: params[:password_reset][:email].downcase) 11 | if @user 12 | @user.create_reset_digest 13 | @user.send_password_reset_email 14 | flash[:info] = "Email sent with password reset instructions" 15 | redirect_to root_url 16 | else 17 | flash.now[:danger] = "Email address not found" 18 | render 'new' 19 | end 20 | end 21 | 22 | def edit 23 | end 24 | 25 | def update 26 | if params[:user][:password].empty? 27 | @user.errors.add(:password, "can't be empty") 28 | render 'edit' 29 | elsif @user.update_attributes(user_params) 30 | log_in @user 31 | flash[:success] = "Password has been reset." 32 | redirect_to @user 33 | else 34 | render 'edit' 35 | end 36 | end 37 | 38 | private 39 | 40 | def user_params 41 | params.require(:user).permit(:password, :password_confirmation) 42 | end 43 | 44 | def get_user 45 | @user = User.find_by(email: params[:email]) 46 | end 47 | 48 | # Confirms a valid user. 49 | def valid_user 50 | unless (@user && @user.authenticated?(:reset, params[:id])) 51 | redirect_to root_url 52 | end 53 | end 54 | 55 | # Checks expiration of reset token. 56 | def check_expiration 57 | if @user.password_reset_expired? 58 | flash[:danger] = "Password reset has expired." 59 | redirect_to new_password_reset_url 60 | end 61 | end 62 | end 63 | -------------------------------------------------------------------------------- /app/controllers/api/sessions_controller.rb: -------------------------------------------------------------------------------- 1 | module Api 2 | class SessionsController < ApplicationController 3 | 4 | def new 5 | end 6 | #If user login data are valid it will return the access_token so the 7 | #client app can use it for future request for the specific user. 8 | def create 9 | user = User.find_by(email: params[:session][:email].downcase) 10 | if user && user.authenticate(params[:session][:password]) 11 | render :text => user.access_token, status: 200 12 | else 13 | render text: "Email and password combination are invalid", status: 422 14 | end 15 | end 16 | #Verifies the access_token so the client app would know if to login the user. 17 | def verify_access_token 18 | user = User.find_by(access_token: params[:session][:access_token]) 19 | if user 20 | render text: "verified", status: 200 21 | else 22 | render text: "Token failed verification", status: 422 23 | end 24 | end 25 | 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /app/controllers/api/users_controller.rb: -------------------------------------------------------------------------------- 1 | module Api 2 | class UsersController < ApplicationController 3 | 4 | before_action :set_user, only: [:show, :edit, :update, :destroy] 5 | 6 | 7 | # GET /users 8 | def index 9 | @users = User.all 10 | end 11 | 12 | # GET /users/1 13 | def show 14 | end 15 | 16 | # GET /users/new 17 | def new 18 | @user = User.new 19 | end 20 | 21 | # GET /users/1/edit 22 | def edit 23 | if @user 24 | render json: @user, only: [:email, :name], status: 200 25 | else 26 | render text: "Unidentified user", status: 422 27 | end 28 | end 29 | 30 | # POST /users 31 | def create 32 | @user = User.new(user_params) 33 | if @user.save 34 | render text: @user.access_token, status: 201 35 | else 36 | render json: @user.errors, status: 422 37 | end 38 | end 39 | 40 | # PATCH/PUT /users/1 41 | def update 42 | if @user.update_attributes(user_params) 43 | render text: "Account has been updated successfully", status: 200 44 | else 45 | render json: @user.errors, status: 422 46 | end 47 | end 48 | 49 | # DELETE /users/1 50 | def destroy 51 | if @user.destroy 52 | render text: "Account has been deleted successfuly", status: 200 53 | else 54 | render text: "Something went wrong", status: 422 55 | end 56 | end 57 | 58 | private 59 | # Use callbacks to share common setup or constraints between actions. 60 | def set_user 61 | @user = User.find_by(access_token: params[:access_token]) 62 | end 63 | 64 | # Never trust parameters from the scary internet, only allow the white list through. 65 | def user_params 66 | params.require(:user).permit(:name, :email, :password, :password_confirmation) 67 | end 68 | 69 | end 70 | end 71 | -------------------------------------------------------------------------------- /app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | # Prevent CSRF attacks by raising an exception. 3 | # For APIs, you may want to use :null_session instead. 4 | protect_from_forgery with: :null_session 5 | include SessionsHelper 6 | end 7 | -------------------------------------------------------------------------------- /app/controllers/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itzikbenh/Rails-React-Auth/631bfc9fa83a1c1a60c68bb0020fef1ca67f26d2/app/controllers/concerns/.keep -------------------------------------------------------------------------------- /app/controllers/password_resets_controller.rb: -------------------------------------------------------------------------------- 1 | class PasswordResetsController < ApplicationController 2 | before_action :get_user, only: [:edit, :update] 3 | before_action :valid_user, only: [:edit, :update] 4 | before_action :check_expiration, only: [:edit, :update] 5 | 6 | def new 7 | end 8 | 9 | def create 10 | @user = User.find_by(email: params[:password_reset][:email].downcase) 11 | if @user 12 | @user.create_reset_digest 13 | @user.send_password_reset_email 14 | flash[:info] = "Email sent with password reset instructions" 15 | redirect_to root_url 16 | else 17 | flash.now[:danger] = "Email address not found" 18 | render 'new' 19 | end 20 | end 21 | 22 | def edit 23 | end 24 | 25 | def update 26 | if params[:user][:password].empty? 27 | @user.errors.add(:password, "can't be empty") 28 | render 'edit' 29 | elsif @user.update_attributes(user_params) 30 | log_in @user 31 | flash[:success] = "Password has been reset." 32 | redirect_to @user 33 | else 34 | render 'edit' 35 | end 36 | end 37 | 38 | private 39 | 40 | def user_params 41 | params.require(:user).permit(:password, :password_confirmation) 42 | end 43 | 44 | def get_user 45 | @user = User.find_by(email: params[:email]) 46 | end 47 | 48 | # Confirms a valid user. 49 | def valid_user 50 | unless (@user && @user.authenticated?(:reset, params[:id])) 51 | redirect_to root_url 52 | end 53 | end 54 | 55 | # Checks expiration of reset token. 56 | def check_expiration 57 | if @user.password_reset_expired? 58 | flash[:danger] = "Password reset has expired." 59 | redirect_to new_password_reset_url 60 | end 61 | end 62 | end 63 | -------------------------------------------------------------------------------- /app/controllers/sessions_controller.rb: -------------------------------------------------------------------------------- 1 | class SessionsController < ApplicationController 2 | 3 | def new 4 | end 5 | 6 | def create 7 | user = User.find_by(email: params[:session][:email].downcase) 8 | if user && user.authenticate(params[:session][:password]) 9 | log_in user 10 | params[:session][:remember_me] == '1' ? remember(user) : forget(user) 11 | flash[:success] = 'You have logged in successfully' 12 | redirect_back_or user 13 | else 14 | flash.now[:danger] = 'Invalid email/password combination' 15 | render 'new' 16 | end 17 | end 18 | 19 | def destroy 20 | log_out if logged_in? 21 | redirect_to root_url 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /app/controllers/users_controller.rb: -------------------------------------------------------------------------------- 1 | class UsersController < ApplicationController 2 | 3 | before_action :set_user, only: [:show, :edit, :update, :destroy] 4 | before_action :logged_in_user, only: [:edit, :update] 5 | before_action :correct_user, only: [:edit, :update] 6 | #respond_to :json, :html 7 | 8 | # GET /users 9 | # GET /users.json 10 | def index 11 | @users = User.all 12 | end 13 | 14 | # GET /users/1 15 | # GET /users/1.json 16 | def show 17 | end 18 | 19 | # GET /users/new 20 | def new 21 | @user = User.new 22 | end 23 | 24 | # GET /users/1/edit 25 | def edit 26 | end 27 | 28 | # POST /users 29 | def create 30 | @user = User.new(user_params) 31 | if @user.save 32 | log_in @user 33 | flash[:success] = 'Account was successfully created.' 34 | redirect_to @user 35 | else 36 | render :new 37 | end 38 | end 39 | 40 | # PATCH/PUT /users/1 41 | def update 42 | if @user.update_attributes(user_params) 43 | flash[:success] = 'Account was successfully updated.' 44 | redirect_to @user 45 | else 46 | render :edit 47 | end 48 | end 49 | 50 | # DELETE /users/1 51 | # DELETE /users/1.json 52 | def destroy 53 | if @user.destroy 54 | flash[:success] = 'Account was successfully destroyed.' 55 | redirect_to root_url 56 | end 57 | end 58 | 59 | private 60 | # Use callbacks to share common setup or constraints between actions. 61 | def set_user 62 | @user = User.find(params[:id]) 63 | end 64 | 65 | # Never trust parameters from the scary internet, only allow the white list through. 66 | def user_params 67 | params.require(:user).permit(:name, :email, :password, :password_confirmation) 68 | end 69 | 70 | # Confirms a logged-in user. 71 | def logged_in_user 72 | unless logged_in? 73 | store_location 74 | flash[:danger] = "Please log in." 75 | redirect_to login_url 76 | end 77 | end 78 | 79 | # Confirms the correct user. 80 | def correct_user 81 | @user = User.find(params[:id]) 82 | redirect_to(root_url) unless current_user?(@user) 83 | end 84 | end 85 | -------------------------------------------------------------------------------- /app/controllers/welcome_controller.rb: -------------------------------------------------------------------------------- 1 | class WelcomeController < ApplicationController 2 | def welcome 3 | @test = "hello" 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /app/helpers/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itzikbenh/Rails-React-Auth/631bfc9fa83a1c1a60c68bb0020fef1ca67f26d2/app/helpers/.DS_Store -------------------------------------------------------------------------------- /app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/password_resets_helper.rb: -------------------------------------------------------------------------------- 1 | module PasswordResetsHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/sessions_helper.rb: -------------------------------------------------------------------------------- 1 | module SessionsHelper 2 | # Logs in the given user. 3 | def log_in(user) 4 | session[:user_id] = user.id 5 | end 6 | 7 | # Remembers a user in a persistent session. 8 | # signed creates an encrypted cookie so that's why we use it. 9 | def remember(user) 10 | user.remember 11 | cookies.permanent.signed[:user_id] = user.id 12 | cookies.permanent[:remember_token] = user.remember_token 13 | end 14 | 15 | # Returns true if the given user is the current user. 16 | def current_user?(user) 17 | user == current_user 18 | end 19 | 20 | # Returns the current logged-in user (if any). 21 | def current_user 22 | if (user_id = session[:user_id]) 23 | @current_user ||= User.find_by(id: user_id) 24 | elsif (user_id = cookies.signed[:user_id]) 25 | user = User.find_by(id: user_id) 26 | if user && user.authenticated?(cookies[:remember_token]) 27 | log_in user 28 | @current_user = user 29 | end 30 | end 31 | end 32 | 33 | # Returns true if the user is logged in, false otherwise. 34 | def logged_in? 35 | !current_user.nil? 36 | end 37 | 38 | # Forgets a persistent session. 39 | def forget(user) 40 | user.forget 41 | cookies.delete(:user_id) 42 | cookies.delete(:remember_token) 43 | end 44 | 45 | def log_out 46 | forget(current_user) 47 | session.delete(:user_id) 48 | @current_user = nil 49 | end 50 | 51 | # Redirects to stored location (or to the default). 52 | def redirect_back_or(default) 53 | redirect_to(session[:forwarding_url] || default) 54 | session.delete(:forwarding_url) 55 | end 56 | 57 | # Stores the URL trying to be accessed. 58 | def store_location 59 | session[:forwarding_url] = request.url if request.get? 60 | end 61 | end 62 | -------------------------------------------------------------------------------- /app/helpers/welcome_helper.rb: -------------------------------------------------------------------------------- 1 | module WelcomeHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/mailers/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itzikbenh/Rails-React-Auth/631bfc9fa83a1c1a60c68bb0020fef1ca67f26d2/app/mailers/.DS_Store -------------------------------------------------------------------------------- /app/mailers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itzikbenh/Rails-React-Auth/631bfc9fa83a1c1a60c68bb0020fef1ca67f26d2/app/mailers/.keep -------------------------------------------------------------------------------- /app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | class ApplicationMailer < ActionMailer::Base 2 | default from: "noreply@example.com" 3 | layout 'mailer' 4 | end 5 | -------------------------------------------------------------------------------- /app/mailers/user_mailer.rb: -------------------------------------------------------------------------------- 1 | class UserMailer < ApplicationMailer 2 | 3 | def password_reset(user) 4 | @user = user 5 | mail to: user.email, subject: "Password reset" 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /app/models/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itzikbenh/Rails-React-Auth/631bfc9fa83a1c1a60c68bb0020fef1ca67f26d2/app/models/.keep -------------------------------------------------------------------------------- /app/models/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itzikbenh/Rails-React-Auth/631bfc9fa83a1c1a60c68bb0020fef1ca67f26d2/app/models/concerns/.keep -------------------------------------------------------------------------------- /app/models/user.rb: -------------------------------------------------------------------------------- 1 | class User < ActiveRecord::Base 2 | attr_accessor :remember_token, :reset_token 3 | before_save :downcase_email 4 | before_create :generate_access_token 5 | 6 | validates :name, presence: true, length: { maximum: 50 } 7 | VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\-.]+\.[a-z]+\z/i 8 | validates :email, presence: true, length: { maximum: 255 }, 9 | format: { with: VALID_EMAIL_REGEX }, 10 | uniqueness: { case_sensitive: false } 11 | has_secure_password 12 | validates :password, length: { minimum: 6 }, allow_nil: true 13 | 14 | # Returns the hash digest of the given string. 15 | def User.digest(string) 16 | cost = ActiveModel::SecurePassword.min_cost ? BCrypt::Engine::MIN_COST : 17 | BCrypt::Engine.cost 18 | BCrypt::Password.create(string, cost: cost) 19 | end 20 | 21 | # Returns a random token. 22 | def User.new_token 23 | SecureRandom.urlsafe_base64 24 | end 25 | 26 | # Remembers a user in the database for use in persistent sessions. 27 | def remember 28 | self.remember_token = User.new_token 29 | update_attribute(:remember_digest, User.digest(remember_token)) 30 | end 31 | 32 | # Returns true if the given token matches the digest. 33 | def authenticated?(attribute, token) 34 | digest = self.send("#{attribute}_digest") 35 | return false if digest.nil? 36 | BCrypt::Password.new(digest).is_password?(token) 37 | end 38 | 39 | # Forgets a user. 40 | def forget 41 | update_attribute(:remember_digest, nil) 42 | end 43 | 44 | # Sets the password reset attributes. 45 | def create_reset_digest 46 | self.reset_token = User.new_token 47 | update_attribute(:reset_digest, User.digest(reset_token)) 48 | update_attribute(:reset_sent_at, Time.zone.now) 49 | end 50 | 51 | # Sends password reset email. 52 | def send_password_reset_email 53 | UserMailer.password_reset(self).deliver_now 54 | end 55 | 56 | # Returns true if a password reset has expired. 57 | def password_reset_expired? 58 | reset_sent_at < 2.hours.ago 59 | end 60 | 61 | private 62 | 63 | # Converts email to all lower-case. 64 | def downcase_email 65 | self.email = email.downcase 66 | end 67 | 68 | def generate_access_token 69 | begin 70 | self.access_token = User.new_token 71 | end while self.class.exists?(access_token: access_token) 72 | end 73 | end 74 | -------------------------------------------------------------------------------- /app/views/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itzikbenh/Rails-React-Auth/631bfc9fa83a1c1a60c68bb0020fef1ca67f26d2/app/views/.DS_Store -------------------------------------------------------------------------------- /app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | RailsReactAuth 5 | <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> 6 | <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> 7 | <%= csrf_meta_tags %> 8 | 9 | 10 | 11 | 12 | <% flash.each do |name, msg| %> 13 | <% if name != "danger" %> 14 | <%= content_tag :div, msg, class: "alert alert-success" %> 15 | <% end %> 16 | <% end %> 17 | 18 | 19 | <%= yield %> 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/views/password_resets/edit.html.erb: -------------------------------------------------------------------------------- 1 |

Reset password

2 | 3 |
4 |
5 | <%= form_for(@user, url: password_reset_path(params[:id])) do |f| %> 6 | <%= render 'shared/error_messages', object: f.object %> 7 | 8 | <%= hidden_field_tag :email, @user.email %> 9 | 10 | <%= f.label :password %> 11 | <%= f.password_field :password, class: 'form-control' %> 12 | 13 | <%= f.label :password_confirmation, "Confirmation" %> 14 | <%= f.password_field :password_confirmation, class: 'form-control' %> 15 | 16 | <%= f.submit "Update password", class: "btn btn-primary" %> 17 | <% end %> 18 |
19 |
20 | -------------------------------------------------------------------------------- /app/views/password_resets/new.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 | Rest Password 6 |
7 |
8 | <%= form_for(:password_reset, url: password_resets_path) do |f| %> 9 | <% if flash[:danger] %> 10 |
<%= flash[:danger] %>
11 | <% end %> 12 |
13 | <%= f.label :email %> 14 | <%= f.email_field :email, class: 'form-control' %> 15 |
16 | <%= f.submit "Send Password Reset Link", class: "btn btn-primary" %> 17 | <% end %> 18 |
19 |
20 |
21 |
22 | -------------------------------------------------------------------------------- /app/views/sessions/new.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 | Sign In 6 |
7 | 8 |
9 | <%= form_for(:session, url: login_path) do |f| %> 10 | <% if flash[:danger] %> 11 |
<%= flash[:danger] %>
12 | <% end %> 13 |
14 | <%= f.label :email %> 15 | <%= f.email_field :email, class: 'form-control' %> 16 |
17 | 18 |
19 | <%= f.label :password %> 20 | <%= link_to "(Forgot Your Password?)", new_password_reset_path %> 21 | <%= f.password_field :password, class: 'form-control' %> 22 |
23 | 24 |
25 | <%= f.check_box :remember_me %> Remember me 26 |
27 | 28 | <%= f.submit "Log in", class: "btn btn-primary" %> 29 | <% end %> 30 |
31 |

New user? <%= link_to "Sign up now!", signup_path %>

32 |
33 |
34 |
35 |
36 | -------------------------------------------------------------------------------- /app/views/shared/_error_messages.html.erb: -------------------------------------------------------------------------------- 1 | <% if object.errors.any? %> 2 | 3 |
4 | Whoops! There were some problems with your input. 5 | 11 |
12 | 13 | <% end %> 14 | -------------------------------------------------------------------------------- /app/views/user_mailer/password_reset.html.erb: -------------------------------------------------------------------------------- 1 |

Password reset

2 | 3 |

To reset your password click the link below:

4 | 5 | <%= link_to "Reset password", edit_password_reset_url(@user.reset_token, email: @user.email) %> 6 | 7 |

This link will expire in two hours.

8 | 9 |

10 | If you did not request your password to be reset, please ignore this email and 11 | your password will stay as it is. 12 |

13 | -------------------------------------------------------------------------------- /app/views/user_mailer/password_reset.text.erb: -------------------------------------------------------------------------------- 1 | To reset your password click the link below: 2 | 3 | <%= edit_password_reset_url(@user.reset_token, email: @user.email) %> 4 | 5 | This link will expire in two hours. 6 | 7 | If you did not request your password to be reset, please ignore this email and 8 | your password will stay as it is. 9 | -------------------------------------------------------------------------------- /app/views/users/_form.html.erb: -------------------------------------------------------------------------------- 1 | <%= form_for(@user) do |f| %> 2 | <% if @user.errors.any? %> 3 |
4 |

<%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:

5 | 6 | 11 |
12 | <% end %> 13 | 14 | <%= f.label :name %> 15 | <%= f.text_field :name %> 16 | 17 | <%= f.label :email %> 18 | <%= f.email_field :email %> 19 | 20 | <%= f.label :password %> 21 | <%= f.password_field :password %> 22 | 23 | <%= f.label :password_confirmation, "Confirmation" %> 24 | <%= f.password_field :password_confirmation %> 25 | 26 |
27 | <%= f.submit "Create my account" %> 28 |
29 | <% end %> 30 | -------------------------------------------------------------------------------- /app/views/users/edit.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 | Edit 6 |
7 |
8 | 9 | <%= form_for(@user) do |f| %> 10 | <%= render 'shared/error_messages', object: f.object %> 11 | 12 |
13 | <%= f.label :name %> 14 | <%= f.text_field :name, class: "form-control" %> 15 |
16 | 17 |
18 | <%= f.label :email %> 19 | <%= f.text_field :email, class: "form-control" %> 20 |
21 | 22 |
23 | <%= f.label :password %> 24 | <%= f.password_field :password, class: "form-control" %> 25 |
26 | 27 |
28 | <%= f.label :password_confirmation, "Confirm Password" %> 29 | <%= f.password_field :password_confirmation, class: "form-control" %> 30 |
31 | 32 | <%= f.submit "Save changes", class: "btn btn-large btn-primary" %> 33 | <% end %> 34 |
35 |
36 |

Unhappy?

37 | <%= link_to 'Delete account', @user, class: "deleteAccount btn btn-xs btn-danger", method: :delete, data: { confirm: 'Are you sure?' } %> 38 |
39 |
40 |
41 |
42 |
43 | -------------------------------------------------------------------------------- /app/views/users/index.html.erb: -------------------------------------------------------------------------------- 1 |

<%= notice %>

2 | 3 |

Welcome Super Full Stack Unicorn

4 |

5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | <% @users.each do |user| %> 16 | 17 | 18 | 19 | 20 | 21 | <% end %> 22 | 23 |
NameEmailAccess Token
<%= user.name %><%= user.email %><%= user.access_token %>
24 |
25 |
26 | -------------------------------------------------------------------------------- /app/views/users/index.json.jbuilder: -------------------------------------------------------------------------------- 1 | json.array!(@users) do |user| 2 | json.extract! user, :id 3 | json.url user_url(user, format: :json) 4 | end 5 | -------------------------------------------------------------------------------- /app/views/users/new.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 | Sign up 6 |
7 |
8 | 9 | <%= form_for(@user) do |f| %> 10 | <%= render 'shared/error_messages', object: f.object %> 11 | 12 |
13 | <%= f.label :name %> 14 | <%= f.text_field :name, class: "form-control" %> 15 |
16 | 17 |
18 | <%= f.label :email %> 19 | <%= f.text_field :email, class: "form-control" %> 20 |
21 | 22 |
23 | <%= f.label :password %> 24 | <%= f.password_field :password, class: "form-control" %> 25 |
26 | 27 |
28 | <%= f.label :password_confirmation, "Confirmation" %> 29 | <%= f.password_field :password_confirmation, class: "form-control" %> 30 |
31 | 32 | <%= f.submit "Create my account", class: "btn btn-large btn-primary" %> 33 | <% end %> 34 | 35 |
36 |
37 |
38 |
39 | -------------------------------------------------------------------------------- /app/views/users/show.html.erb: -------------------------------------------------------------------------------- 1 | 2 |

3 | <%= @user.name %> 4 |

5 | 6 | <%= link_to 'Edit', edit_user_path(@user) %> | 7 | <%= link_to 'Back', users_path %> 8 | -------------------------------------------------------------------------------- /app/views/users/show.json.jbuilder: -------------------------------------------------------------------------------- 1 | json.extract! @user, :id, :created_at, :updated_at 2 | -------------------------------------------------------------------------------- /app/views/welcome/welcome.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

Rails on Mobile

4 |

5 | This is a Rails boilerplate app. It contains a complete Auth system based on Michael Hartl's 6 | "Ruby on Rails tutorial" book. 7 | I also added an API boilerplate that works perfect with my React Native tutorial. I'm using an 8 | access_token in order to identify the user. It will be generated automatically once the user 9 | registers or logs in. 10 | I'm using MySql here so feel free to change it. 11 |

12 |

13 | Take a look at my tutorial or at the API folder to understand how things work. 14 |

15 |
16 |
17 | -------------------------------------------------------------------------------- /bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | APP_PATH = File.expand_path('../../config/application', __FILE__) 8 | require_relative '../config/boot' 9 | require 'rails/commands' 10 | -------------------------------------------------------------------------------- /bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | require_relative '../config/boot' 8 | require 'rake' 9 | Rake.application.run 10 | -------------------------------------------------------------------------------- /bin/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require 'pathname' 3 | 4 | # path to your application root. 5 | APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) 6 | 7 | Dir.chdir APP_ROOT do 8 | # This script is a starting point to setup your application. 9 | # Add necessary setup steps to this file: 10 | 11 | puts "== Installing dependencies ==" 12 | system "gem install bundler --conservative" 13 | system "bundle check || bundle install" 14 | 15 | # puts "\n== Copying sample files ==" 16 | # unless File.exist?("config/database.yml") 17 | # system "cp config/database.yml.sample config/database.yml" 18 | # end 19 | 20 | puts "\n== Preparing database ==" 21 | system "bin/rake db:setup" 22 | 23 | puts "\n== Removing old logs and tempfiles ==" 24 | system "rm -f log/*" 25 | system "rm -rf tmp/cache" 26 | 27 | puts "\n== Restarting application server ==" 28 | system "touch tmp/restart.txt" 29 | end 30 | -------------------------------------------------------------------------------- /bin/spring: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # This file loads spring without using Bundler, in order to be fast. 4 | # It gets overwritten when you run the `spring binstub` command. 5 | 6 | unless defined?(Spring) 7 | require 'rubygems' 8 | require 'bundler' 9 | 10 | if (match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m)) 11 | Gem.paths = { 'GEM_PATH' => [Bundler.bundle_path.to_s, *Gem.path].uniq.join(Gem.path_separator) } 12 | gem 'spring', match[1] 13 | require 'spring/binstub' 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require ::File.expand_path('../config/environment', __FILE__) 4 | run Rails.application 5 | -------------------------------------------------------------------------------- /config/application.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../boot', __FILE__) 2 | 3 | require 'rails/all' 4 | 5 | # Require the gems listed in Gemfile, including any gems 6 | # you've limited to :test, :development, or :production. 7 | Bundler.require(*Rails.groups) 8 | 9 | module RailsReactAuth 10 | class Application < Rails::Application 11 | 12 | config.middleware.insert_before 'Rack::Runtime', 'Rack::Cors' do 13 | allow do 14 | origins '*' 15 | resource '*', 16 | headers: :any, 17 | methods: [:get, :put, :post, :patch, :delete, :options] 18 | end 19 | end 20 | 21 | config.active_record.raise_in_transactional_callbacks = true 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 2 | 3 | require 'bundler/setup' # Set up gems listed in the Gemfile. 4 | -------------------------------------------------------------------------------- /config/database.yml: -------------------------------------------------------------------------------- 1 | # MySQL. Versions 5.0+ are recommended. 2 | # 3 | # Install the MYSQL driver 4 | # gem install mysql2 5 | # 6 | # Ensure the MySQL gem is defined in your Gemfile 7 | # gem 'mysql2' 8 | # 9 | # And be sure to use new-style password hashing: 10 | # http://dev.mysql.com/doc/refman/5.0/en/old-client.html 11 | # 12 | default: &default 13 | adapter: mysql2 14 | encoding: utf8 15 | pool: 5 16 | username: root 17 | password: root 18 | socket: /tmp/mysql.sock 19 | 20 | development: 21 | <<: *default 22 | database: rails_react_auth_development 23 | 24 | # Warning: The database defined as "test" will be erased and 25 | # re-generated from your development database when you run "rake". 26 | # Do not set this db to the same as development or production. 27 | test: 28 | <<: *default 29 | database: rails_react_auth_test 30 | 31 | # As with config/secrets.yml, you never want to store sensitive information, 32 | # like your database password, in your source code. If your source code is 33 | # ever seen by anyone, they now have access to your database. 34 | # 35 | # Instead, provide the password as a unix environment variable when you boot 36 | # the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database 37 | # for a full rundown on how to provide these environment variables in a 38 | # production deployment. 39 | # 40 | # On Heroku and other platform providers, you may have a full connection URL 41 | # available as an environment variable. For example: 42 | # 43 | # DATABASE_URL="mysql2://myuser:mypass@localhost/somedatabase" 44 | # 45 | # You can use this database configuration with: 46 | # 47 | # production: 48 | # url: <%= ENV['DATABASE_URL'] %> 49 | # 50 | production: 51 | <<: *default 52 | database: rails_react_auth_production 53 | username: rails_react_auth 54 | password: <%= ENV['RAILS_REACT_AUTH_DATABASE_PASSWORD'] %> 55 | -------------------------------------------------------------------------------- /config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require File.expand_path('../application', __FILE__) 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /config/environments/development.rb: -------------------------------------------------------------------------------- 1 | Rails.application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # In the development environment your application's code is reloaded on 5 | # every request. This slows down response time but is perfect for development 6 | # since you don't have to restart the web server when you make code changes. 7 | config.cache_classes = false 8 | 9 | # Do not eager load code on boot. 10 | config.eager_load = false 11 | 12 | # Show full error reports and disable caching. 13 | config.consider_all_requests_local = true 14 | config.action_controller.perform_caching = false 15 | 16 | # Don't care if the mailer can't send. 17 | config.action_mailer.raise_delivery_errors = false 18 | host = 'localhost:3000' 19 | config.action_mailer.default_url_options = { host: host, protocol: 'http' } 20 | 21 | # Print deprecation notices to the Rails logger. 22 | config.active_support.deprecation = :log 23 | 24 | # Raise an error on page load if there are pending migrations. 25 | config.active_record.migration_error = :page_load 26 | 27 | # Debug mode disables concatenation and preprocessing of assets. 28 | # This option may cause significant delays in view rendering with a large 29 | # number of complex assets. 30 | config.assets.debug = true 31 | 32 | # Asset digests allow you to set far-future HTTP expiration dates on all assets, 33 | # yet still be able to expire them through the digest params. 34 | config.assets.digest = true 35 | 36 | # Adds additional error checking when serving assets at runtime. 37 | # Checks for improperly declared sprockets dependencies. 38 | # Raises helpful error messages. 39 | config.assets.raise_runtime_errors = true 40 | 41 | # Raises error for missing translations 42 | # config.action_view.raise_on_missing_translations = true 43 | end 44 | -------------------------------------------------------------------------------- /config/environments/production.rb: -------------------------------------------------------------------------------- 1 | Rails.application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # Code is not reloaded between requests. 5 | config.cache_classes = true 6 | 7 | # Eager load code on boot. This eager loads most of Rails and 8 | # your application in memory, allowing both threaded web servers 9 | # and those relying on copy on write to perform better. 10 | # Rake tasks automatically ignore this option for performance. 11 | config.eager_load = true 12 | 13 | # Full error reports are disabled and caching is turned on. 14 | config.consider_all_requests_local = false 15 | config.action_controller.perform_caching = true 16 | 17 | # Enable Rack::Cache to put a simple HTTP cache in front of your application 18 | # Add `rack-cache` to your Gemfile before enabling this. 19 | # For large-scale production use, consider using a caching reverse proxy like 20 | # NGINX, varnish or squid. 21 | # config.action_dispatch.rack_cache = true 22 | 23 | # Disable serving static files from the `/public` folder by default since 24 | # Apache or NGINX already handles this. 25 | config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present? 26 | 27 | # Compress JavaScripts and CSS. 28 | config.assets.js_compressor = :uglifier 29 | # config.assets.css_compressor = :sass 30 | 31 | # Do not fallback to assets pipeline if a precompiled asset is missed. 32 | config.assets.compile = false 33 | 34 | # Asset digests allow you to set far-future HTTP expiration dates on all assets, 35 | # yet still be able to expire them through the digest params. 36 | config.assets.digest = true 37 | 38 | # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb 39 | 40 | # Specifies the header that your server uses for sending files. 41 | # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache 42 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX 43 | 44 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. 45 | # config.force_ssl = true 46 | 47 | # Use the lowest log level to ensure availability of diagnostic information 48 | # when problems arise. 49 | config.log_level = :debug 50 | 51 | # Prepend all log lines with the following tags. 52 | # config.log_tags = [ :subdomain, :uuid ] 53 | 54 | # Use a different logger for distributed setups. 55 | # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) 56 | 57 | # Use a different cache store in production. 58 | # config.cache_store = :mem_cache_store 59 | 60 | # Enable serving of images, stylesheets, and JavaScripts from an asset server. 61 | # config.action_controller.asset_host = 'http://assets.example.com' 62 | 63 | # Ignore bad email addresses and do not raise email delivery errors. 64 | # Set this to true and configure the email server for immediate delivery to raise delivery errors. 65 | # config.action_mailer.raise_delivery_errors = false 66 | 67 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to 68 | # the I18n.default_locale when a translation cannot be found). 69 | config.i18n.fallbacks = true 70 | 71 | # Send deprecation notices to registered listeners. 72 | config.active_support.deprecation = :notify 73 | 74 | # Use default logging formatter so that PID and timestamp are not suppressed. 75 | config.log_formatter = ::Logger::Formatter.new 76 | 77 | # Do not dump schema after migrations. 78 | config.active_record.dump_schema_after_migration = false 79 | end 80 | -------------------------------------------------------------------------------- /config/environments/test.rb: -------------------------------------------------------------------------------- 1 | Rails.application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # The test environment is used exclusively to run your application's 5 | # test suite. You never need to work with it otherwise. Remember that 6 | # your test database is "scratch space" for the test suite and is wiped 7 | # and recreated between test runs. Don't rely on the data there! 8 | config.cache_classes = true 9 | 10 | # Do not eager load code on boot. This avoids loading your whole application 11 | # just for the purpose of running a single test. If you are using a tool that 12 | # preloads Rails for running tests, you may have to set it to true. 13 | config.eager_load = false 14 | 15 | # Configure static file server for tests with Cache-Control for performance. 16 | config.serve_static_files = true 17 | config.static_cache_control = 'public, max-age=3600' 18 | 19 | # Show full error reports and disable caching. 20 | config.consider_all_requests_local = true 21 | config.action_controller.perform_caching = false 22 | 23 | # Raise exceptions instead of rendering exception templates. 24 | config.action_dispatch.show_exceptions = false 25 | 26 | # Disable request forgery protection in test environment. 27 | config.action_controller.allow_forgery_protection = false 28 | 29 | # Tell Action Mailer not to deliver emails to the real world. 30 | # The :test delivery method accumulates sent emails in the 31 | # ActionMailer::Base.deliveries array. 32 | config.action_mailer.delivery_method = :test 33 | 34 | # Randomize the order test cases are executed. 35 | config.active_support.test_order = :random 36 | 37 | # Print deprecation notices to the stderr. 38 | config.active_support.deprecation = :stderr 39 | 40 | # Raises error for missing translations 41 | # config.action_view.raise_on_missing_translations = true 42 | end 43 | -------------------------------------------------------------------------------- /config/initializers/assets.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Version of your assets, change this if you want to expire all your assets. 4 | Rails.application.config.assets.version = '1.0' 5 | 6 | # Add additional assets to the asset load path 7 | # Rails.application.config.assets.paths << Emoji.images_path 8 | 9 | # Precompile additional assets. 10 | # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. 11 | # Rails.application.config.assets.precompile += %w( search.js ) 12 | -------------------------------------------------------------------------------- /config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. 7 | # Rails.backtrace_cleaner.remove_silencers! 8 | -------------------------------------------------------------------------------- /config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.action_dispatch.cookies_serializer = :json 4 | -------------------------------------------------------------------------------- /config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, '\1en' 8 | # inflect.singular /^(ox)en/i, '\1' 9 | # inflect.irregular 'person', 'people' 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym 'RESTful' 16 | # end 17 | -------------------------------------------------------------------------------- /config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.session_store :cookie_store, key: '_rails_react_auth_session' 4 | -------------------------------------------------------------------------------- /config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] if respond_to?(:wrap_parameters) 9 | end 10 | 11 | # To enable root element in JSON for ActiveRecord objects. 12 | # ActiveSupport.on_load(:active_record) do 13 | # self.include_root_in_json = true 14 | # end 15 | -------------------------------------------------------------------------------- /config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Files in the config/locales directory are used for internationalization 2 | # and are automatically loaded by Rails. If you want to use locales other 3 | # than English, add the necessary files in this directory. 4 | # 5 | # To use the locales, use `I18n.t`: 6 | # 7 | # I18n.t 'hello' 8 | # 9 | # In views, this is aliased to just `t`: 10 | # 11 | # <%= t('hello') %> 12 | # 13 | # To use a different locale, set it with `I18n.locale`: 14 | # 15 | # I18n.locale = :es 16 | # 17 | # This would use the information in config/locales/es.yml. 18 | # 19 | # To learn more, please read the Rails Internationalization guide 20 | # available at http://guides.rubyonrails.org/i18n.html. 21 | 22 | en: 23 | hello: "Hello world" 24 | -------------------------------------------------------------------------------- /config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | 3 | get 'signup' => 'users#new' 4 | get 'login' => 'sessions#new' 5 | post 'login' => 'sessions#create' 6 | delete 'logout' => 'sessions#destroy' 7 | get 'verify' => 'sessions#verify_access_token' 8 | resources :users 9 | resources :password_resets, only: [:new, :create, :edit, :update] 10 | root 'welcome#welcome' 11 | 12 | namespace :api do 13 | post 'login' => 'sessions#create' 14 | delete 'logout' => 'sessions#destroy' 15 | get 'verify' => 'sessions#verify_access_token' 16 | resources :users, param: :access_token 17 | resources :password_resets, only: [:new, :create, :edit, :update] 18 | end 19 | 20 | end 21 | -------------------------------------------------------------------------------- /config/secrets.yml: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Your secret key is used for verifying the integrity of signed cookies. 4 | # If you change this key, all old signed cookies will become invalid! 5 | 6 | # Make sure the secret is at least 30 characters and all random, 7 | # no regular words or you'll be exposed to dictionary attacks. 8 | # You can use `rake secret` to generate a secure secret key. 9 | 10 | # Make sure the secrets in this file are kept private 11 | # if you're sharing your code publicly. 12 | 13 | development: 14 | secret_key_base: 694814ad3df380eb0afb44bbd2e4490a61b77358dadfe9967aaccc4ff5910f766e04381081c66455898abbe3f24b67e302c047514d4be2aa70a7745a676f04fb 15 | 16 | test: 17 | secret_key_base: d3ef8c3db69e26929e347dfb53dfc13f80d100a54a78a2ad61609677c6c051565a8180dfb1b2611a9bdb858e6db858a0e5ca8ac71470221ca3e4fd3d63f72a3c 18 | 19 | # Do not keep production secrets in the repository, 20 | # instead read values from the environment. 21 | production: 22 | secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> 23 | -------------------------------------------------------------------------------- /db/migrate/20160315235724_create_users.rb: -------------------------------------------------------------------------------- 1 | class CreateUsers < ActiveRecord::Migration 2 | def change 3 | create_table :users do |t| 4 | t.string :name 5 | t.string :email, index: true, unique: true 6 | t.boolean :admin, default: false 7 | t.string :password_digest 8 | t.string :remember_digest 9 | t.string :access_token, index: true, unique: true 10 | t.string :reset_digest 11 | t.datetime :reset_sent_at 12 | 13 | t.timestamps null: false 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /db/schema.rb: -------------------------------------------------------------------------------- 1 | # encoding: UTF-8 2 | # This file is auto-generated from the current state of the database. Instead 3 | # of editing this file, please use the migrations feature of Active Record to 4 | # incrementally modify your database, and then regenerate this schema definition. 5 | # 6 | # Note that this schema.rb definition is the authoritative source for your 7 | # database schema. If you need to create the application database on another 8 | # system, you should be using db:schema:load, not running all the migrations 9 | # from scratch. The latter is a flawed and unsustainable approach (the more migrations 10 | # you'll amass, the slower it'll run and the greater likelihood for issues). 11 | # 12 | # It's strongly recommended that you check this file into your version control system. 13 | 14 | ActiveRecord::Schema.define(version: 20160315235724) do 15 | 16 | create_table "users", force: :cascade do |t| 17 | t.string "name", limit: 255 18 | t.string "email", limit: 255 19 | t.boolean "admin", default: false 20 | t.string "password_digest", limit: 255 21 | t.string "remember_digest", limit: 255 22 | t.string "access_token", limit: 255 23 | t.string "reset_digest", limit: 255 24 | t.datetime "reset_sent_at" 25 | t.datetime "created_at", null: false 26 | t.datetime "updated_at", null: false 27 | end 28 | 29 | add_index "users", ["access_token"], name: "index_users_on_access_token", using: :btree 30 | add_index "users", ["email"], name: "index_users_on_email", using: :btree 31 | 32 | end 33 | -------------------------------------------------------------------------------- /db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) 7 | # Mayor.create(name: 'Emanuel', city: cities.first) 8 | -------------------------------------------------------------------------------- /lib/assets/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itzikbenh/Rails-React-Auth/631bfc9fa83a1c1a60c68bb0020fef1ca67f26d2/lib/assets/.keep -------------------------------------------------------------------------------- /lib/tasks/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itzikbenh/Rails-React-Auth/631bfc9fa83a1c1a60c68bb0020fef1ca67f26d2/lib/tasks/.keep -------------------------------------------------------------------------------- /log/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itzikbenh/Rails-React-Auth/631bfc9fa83a1c1a60c68bb0020fef1ca67f26d2/log/.keep -------------------------------------------------------------------------------- /public/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The page you were looking for doesn't exist (404) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

The page you were looking for doesn't exist.

62 |

You may have mistyped the address or the page may have moved.

63 |
64 |

If you are the application owner check the logs for more information.

65 |
66 | 67 | 68 | -------------------------------------------------------------------------------- /public/422.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The change you wanted was rejected (422) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

The change you wanted was rejected.

62 |

Maybe you tried to change something you didn't have access to.

63 |
64 |

If you are the application owner check the logs for more information.

65 |
66 | 67 | 68 | -------------------------------------------------------------------------------- /public/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | We're sorry, but something went wrong (500) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

We're sorry, but something went wrong.

62 |
63 |

If you are the application owner check the logs for more information.

64 |
65 | 66 | 67 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itzikbenh/Rails-React-Auth/631bfc9fa83a1c1a60c68bb0020fef1ca67f26d2/public/favicon.ico -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /test/controllers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itzikbenh/Rails-React-Auth/631bfc9fa83a1c1a60c68bb0020fef1ca67f26d2/test/controllers/.keep -------------------------------------------------------------------------------- /test/controllers/welcome_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class WelcomeControllerTest < ActionController::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/fixtures/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itzikbenh/Rails-React-Auth/631bfc9fa83a1c1a60c68bb0020fef1ca67f26d2/test/fixtures/.keep -------------------------------------------------------------------------------- /test/fixtures/users.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | # This model initially had no columns defined. If you add columns to the 4 | # model remove the '{}' from the fixture names and add the columns immediately 5 | # below each fixture, per the syntax in the comments below 6 | # 7 | one: {} 8 | # column: value 9 | # 10 | two: {} 11 | # column: value 12 | -------------------------------------------------------------------------------- /test/helpers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itzikbenh/Rails-React-Auth/631bfc9fa83a1c1a60c68bb0020fef1ca67f26d2/test/helpers/.keep -------------------------------------------------------------------------------- /test/integration/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itzikbenh/Rails-React-Auth/631bfc9fa83a1c1a60c68bb0020fef1ca67f26d2/test/integration/.keep -------------------------------------------------------------------------------- /test/mailers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itzikbenh/Rails-React-Auth/631bfc9fa83a1c1a60c68bb0020fef1ca67f26d2/test/mailers/.keep -------------------------------------------------------------------------------- /test/models/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itzikbenh/Rails-React-Auth/631bfc9fa83a1c1a60c68bb0020fef1ca67f26d2/test/models/.keep -------------------------------------------------------------------------------- /test/models/user_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class UserTest < ActiveSupport::TestCase 4 | # test "the truth" do 5 | # assert true 6 | # end 7 | end 8 | -------------------------------------------------------------------------------- /test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV['RAILS_ENV'] ||= 'test' 2 | require File.expand_path('../../config/environment', __FILE__) 3 | require 'rails/test_help' 4 | 5 | class ActiveSupport::TestCase 6 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. 7 | fixtures :all 8 | 9 | # Add more helper methods to be used by all tests here... 10 | end 11 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itzikbenh/Rails-React-Auth/631bfc9fa83a1c1a60c68bb0020fef1ca67f26d2/vendor/assets/javascripts/.keep -------------------------------------------------------------------------------- /vendor/assets/stylesheets/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itzikbenh/Rails-React-Auth/631bfc9fa83a1c1a60c68bb0020fef1ca67f26d2/vendor/assets/stylesheets/.keep --------------------------------------------------------------------------------