about summary refs log tree commit diff stats
path: root/test/dummy/app/controllers
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2017-10-15 13:06:13 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2017-10-15 13:06:13 -0400
commitb68f6cb66ec30f9e9ddd2724592e40ba0a3b22fb (patch)
tree84693064d9c183efd2f35f4bd2609e21b419f4c6 /test/dummy/app/controllers
parente0562c5de8bcc2fb29d0b22a2537f55bd1fc8bd7 (diff)
downloadpokeviewer-b68f6cb66ec30f9e9ddd2724592e40ba0a3b22fb.tar.gz
pokeviewer-b68f6cb66ec30f9e9ddd2724592e40ba0a3b22fb.tar.bz2
pokeviewer-b68f6cb66ec30f9e9ddd2724592e40ba0a3b22fb.zip
Integrated auth into main app
Pokeviewer now expects the main app's ApplicationController to contain a
method called "authenticate_pokeviewer" which will return true iff the
username and token passed to it are valid. An example stub is present in
the test dummy ApplicationController.
Diffstat (limited to 'test/dummy/app/controllers')
-rw-r--r--test/dummy/app/controllers/application_controller.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/dummy/app/controllers/application_controller.rb b/test/dummy/app/controllers/application_controller.rb index 1c07694..95f36f8 100644 --- a/test/dummy/app/controllers/application_controller.rb +++ b/test/dummy/app/controllers/application_controller.rb
@@ -1,3 +1,9 @@
1class ApplicationController < ActionController::Base 1class ApplicationController < ActionController::Base
2 protect_from_forgery with: :exception 2 protect_from_forgery with: :exception
3
4 protected
5
6 def authenticate_pokeviewer(login, token)
7 login == "testuser" and token == "testpass"
8 end
3end 9end