Skip to content

bare-bones alternative to mtdevise, adds basecamp style user logins for rails

License

Notifications You must be signed in to change notification settings

bradpotts/multi-tenancy-warden

Folders and files

NameName
Last commit message
Last commit date

Latest commit

c702f18 · Feb 17, 2018
Apr 28, 2017
Apr 28, 2017
Apr 28, 2017
Apr 28, 2017
Jun 19, 2017
Feb 17, 2018
Sep 29, 2016
Apr 28, 2017
Oct 22, 2017
Apr 28, 2017
Apr 28, 2017
Feb 17, 2018
Nov 26, 2017
Feb 17, 2018
Dec 2, 2017
Feb 17, 2018

Repository files navigation

security Code Climate Gem Version License: MIT

MTWarden Rails 5.1 Multi-Tenancy Engine Documentation

PHC MTWarden Rails 5.1 engine adds a separate multi-tenant layer that handles all user registrations, multi-tenancy app functions, and login through subdomains using Warden authentication gem.

Step 1 - Add Mtwarden to your gemfile and run command

gem 'mtwarden', '~> 17.0'
bundle exec install  

Step 2 - Add and migrate mtwarden database tables

rake railties:install:migrations  
rake db:migrate  

Step 3 - Mount the Engine in your Routes File

Add this line at the top of the routes.rb file.

require 'mtwarden/constraints/subdomain_required'  

Step 4 - Mount the Engine in your Routes File

Add this line at the end of the routes.rb file.

mount Mtwarden::Engine, :at => '/'  

Step 5 - Constrain the routes you want secured under multi-tenancy in your routes.rb file.

All the routes you want to have multi-tenancy login functions goes in between the constraints block.

constraints(Mtwarden::Constraints::SubdomainRequired) do  
	# Routes Requiring Security & Multi-Tenancy Routes    
end