Permalink
Browse files

The start of better error pages.

  • Loading branch information...
nelhage committed Mar 25, 2007
1 parent c0df115 commit 63bc7c120aeea6995aefa522cde10ae111891bed
Showing with 16 additions and 4 deletions.
  1. +4 −2 lib/AuthMitEdu/Dispatcher.pm
  2. +12 −2 lib/AuthMitEdu/View.pm
@@ -32,9 +32,11 @@ on qr{^/_/auth/?$} => run {
}
my %opts = %$data;
- tangent '/_/login' unless $user && $user->is_identity($opts{identity});
-
set $_ => $opts{$_} for keys %opts;
+
+ show '/error/no_cert' unless $user;
+ show '/error/bad_identity' unless $user->is_identity($opts{identity});
+
show 'setup';
} else {
View
@@ -54,9 +54,19 @@ template setup => page {
}
};
-template '/_/login' => page {
+template '/error/no_cert' => page {
p {
- "You need to login";
+ outs("You do not seem to have an MIT Certificate. See IS&T's ");
+ a {{ href is "http://web.mit.edu/ist/topics/certificates/index.html"}
+ "certificate information page"};
+ outs("for more information about how to obtain one.");
+ }
+};
+
+template '/error/bad_identity' => page {
+ p {
+ outs("You are currently authenticated as " . Jifty->web->current_user->username .
+ ", but are trying to authenticate as " . get('identity'));
}
};

0 comments on commit 63bc7c1

Please sign in to comment.