Created
September 26, 2013 18:12
-
-
Save gideondsouza/6718224 to your computer and use it in GitHub Desktop.
test app for my github authentication plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package YourDancerApplication; | |
use Dancer2; | |
use lib "../dancer2-plugin-auth-github/lib"; | |
use Dancer2::Plugin::Auth::Github; | |
set 'session' => 'YAML'; | |
auth_github_init(); | |
get '/' => sub { | |
warn "reading session again.."; | |
#THIS IS ALWAYS UNDEF! | |
warn Data::Dumper::Dumper(session->read('github_user')); | |
if (not defined(session->read('github_user'))) { | |
return redirect auth_github_authenticate_url; | |
} | |
}; | |
#by default authentication failure will redirect to this route | |
get '/fail' => sub { return "Github authentication Failed" }; | |
dance(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment