diff options
author | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2014-05-04 18:35:10 +0200 |
---|---|---|
committer | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2014-05-04 18:35:10 +0200 |
commit | d8907f11f5c255727b8a814746a0114e5c62e30a (patch) | |
tree | 96b1b1e2531a3043e9ab31e66abdd72507136b1d /www/sign.pl | |
parent | 36fafa2ae962d6844b6e20ffbbac92ecf36a059d (diff) |
Support Google Apps authentication.
Diffstat (limited to 'www/sign.pl')
-rwxr-xr-x | www/sign.pl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/www/sign.pl b/www/sign.pl index a0fd11f..b16ff86 100755 --- a/www/sign.pl +++ b/www/sign.pl @@ -4,6 +4,7 @@ use common::sense; use Modern::Perl; +use syntax 'junction'; use JSON; @@ -85,8 +86,8 @@ while (my $cgi = new CGI::Fast) { my $domain; if ($email =~ /^(.*?)@(.*)/) { $domain = $2; } - die "User is not authorized to use this email address" - unless ($session_user ~~ [email_users($email)]); + die "User $session_user is not authorized to use this email address ($email)" + unless any(email_users($email)) eq $session_user; my $sig = sign $key, decode_json($user_pubkey), $email, $duration, $domain; say encode_json({signature => $sig}); |