diff options
| author | mo khan <mo@mokhan.ca> | 2013-12-17 15:22:54 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2013-12-17 15:22:54 -0700 |
| commit | c582f8bbbc54f7fb4f9de912f925ba3cfc1967aa (patch) | |
| tree | 233bbcbbbea8807d0d97a257a6035bcf26eb4e91 | |
| parent | a2bc25ed85ce60b331facb5799942be26a5f8b27 (diff) | |
add route to /home
| -rw-r--r-- | app/controllers/home_controller.rb | 7 | ||||
| -rw-r--r-- | app/views/home/index.html.erb | 8 | ||||
| -rw-r--r-- | config/routes.rb | 55 |
3 files changed, 16 insertions, 54 deletions
diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb new file mode 100644 index 0000000..4ed0f70 --- /dev/null +++ b/app/controllers/home_controller.rb @@ -0,0 +1,7 @@ +class HomeController < ApplicationController + def index + @message = "hello" + @totp = ROTP::TOTP.new("secret") + @hotp = ROTP::HOTP.new("secret") + end +end diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb new file mode 100644 index 0000000..baec791 --- /dev/null +++ b/app/views/home/index.html.erb @@ -0,0 +1,8 @@ +<%= @message %> + +<p> +<%= @totp.provisioning_uri("mokha@cisco.com") %> +</p> +<p> +<%= @hotp.provisioning_uri("mokha@cisco.com") %> +</p> diff --git a/config/routes.rb b/config/routes.rb index 1a316e6..ee925d1 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,56 +1,3 @@ TwoFactor::Application.routes.draw do - # The priority is based upon order of creation: first created -> highest priority. - # See how all your routes lay out with "rake routes". - - # You can have the root of your site routed with "root" - # root 'welcome#index' - - # Example of regular route: - # get 'products/:id' => 'catalog#view' - - # Example of named route that can be invoked with purchase_url(id: product.id) - # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase - - # Example resource route (maps HTTP verbs to controller actions automatically): - # resources :products - - # Example resource route with options: - # resources :products do - # member do - # get 'short' - # post 'toggle' - # end - # - # collection do - # get 'sold' - # end - # end - - # Example resource route with sub-resources: - # resources :products do - # resources :comments, :sales - # resource :seller - # end - - # Example resource route with more complex sub-resources: - # resources :products do - # resources :comments - # resources :sales do - # get 'recent', on: :collection - # end - # end - - # Example resource route with concerns: - # concern :toggleable do - # post 'toggle' - # end - # resources :posts, concerns: :toggleable - # resources :photos, concerns: :toggleable - - # Example resource route within a namespace: - # namespace :admin do - # # Directs /admin/products/* to Admin::ProductsController - # # (app/controllers/admin/products_controller.rb) - # resources :products - # end + root 'home#index' end |
