Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Redirect to error pages

  • Loading branch information...
commit c4725262f0b7b5c3514a06a3feeb7850442c542b 1 parent 63bc7c1
@nelhage authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 lib/AuthMitEdu/Dispatcher.pm
View
9 lib/AuthMitEdu/Dispatcher.pm
@@ -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';
@@ -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';
Please sign in to comment.
Something went wrong with that request. Please try again.