Skip to content

Instantly share code, notes, and snippets.

@gideondsouza
Created September 26, 2013 18:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gideondsouza/6718224 to your computer and use it in GitHub Desktop.
Save gideondsouza/6718224 to your computer and use it in GitHub Desktop.
test app for my github authentication plugin
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