Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Tidy up login/create_user subs (POST and body params)

  • Loading branch information...
commit 2ecfbdde5e8af7af84fc7a7dbca0661554ffe0cc 1 parent 73acc7c
@castaway authored
Showing with 3 additions and 14 deletions.
  1. +3 −14 geotrader.cgi
View
17 geotrader.cgi
@@ -8,24 +8,13 @@ use Web::Simple;
use lib '/mnt/shared/projects/cardsapp/lib';
use GeoTrader;
-# sub dispatch_request {
-# sub (/admin/...) {
-# Web::Simple::Thingy::Auth->new(
-# users_rs => $schema->resultset('User'),
-# make_authed_app => sub { my $user = shift; sub { [ 200, ...
-# make_unauthed_app => sub {
-# my $try_login = shift;
-# ...
-# if ($try_login->($user,$pass)) {
-# ...
-
sub dispatch_request {
my ($self) = @_;
my $user;
my $gt = GeoTrader->new(base_uri => '/cgi-bin/geotrader.cgi');
- $self->check_authenticated($user);
+ $self->check_authenticated($user),
sub (GET + /) {
my ($self) = @_;
@@ -34,7 +23,7 @@ sub dispatch_request {
return [ 200, [ 'Content-type', 'text/html' ], [ $self->default_page($gt) ]];
},
- sub (GET|POST + /login + ?username=&password=) {
+ sub (POST + /login + %username=&password=) {
my ($self, $usern, $passw) = @_;
my $user = $gt->get_check_user($usern, $passw);
@@ -46,7 +35,7 @@ sub dispatch_request {
}
},
- sub (POST + /create_user + ?username=&password=&display=) {
+ sub (POST + /create_user + %username=&password=&display=) {
my ($self, $usern, $passw, $display) = @_;
## FIXME: Check length of inputs!
Please sign in to comment.
Something went wrong with that request. Please try again.