diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-10-15 13:06:13 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-10-15 13:06:13 -0400 |
commit | b68f6cb66ec30f9e9ddd2724592e40ba0a3b22fb (patch) | |
tree | 84693064d9c183efd2f35f4bd2609e21b419f4c6 /test | |
parent | e0562c5de8bcc2fb29d0b22a2537f55bd1fc8bd7 (diff) | |
download | pokeviewer-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')
-rw-r--r-- | test/dummy/app/controllers/application_controller.rb | 6 |
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 @@ | |||
1 | class ApplicationController < ActionController::Base | 1 | class 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 | ||
3 | end | 9 | end |