Skip to content

Commit

Permalink
Redirect to error pages
Browse files Browse the repository at this point in the history
  • Loading branch information
nelhage committed Mar 25, 2007
1 parent 63bc7c1 commit c472526
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/AuthMitEdu/Dispatcher.pm
Expand Up @@ -12,6 +12,11 @@ before '*' => run {
}
};

on '/error/bad_identity/**' => run {
set identity => $1;
show '/error/bad_identity';
};

on qr{^/([a-zA-Z][a-zA-Z_0-9]+)$} => run {
set user => $1;
show '/endpoint';
Expand All @@ -34,8 +39,8 @@ on qr{^/_/auth/?$} => run {
my %opts = %$data;
set $_ => $opts{$_} for keys %opts;

show '/error/no_cert' unless $user;
show '/error/bad_identity' unless $user->is_identity($opts{identity});
redirect '/error/no_cert' unless $user;
redirect '/error/bad_identity/' . $opts{identity} unless $user->is_identity($opts{identity});

show 'setup';

Expand Down

0 comments on commit c472526

Please sign in to comment.