X-Git-Url: https://git-public.kairo.at/?p=authserver.git;a=blobdiff_plain;f=authorize.php;h=4275254873b22fffd0dfaad35dd9490eff2050c4;hp=2a7e0a5a12b4cdb0f37cc265cfc0cb8ed33377ab;hb=3ae4786131db55882ccb0ec34ead383bf6ba3143;hpb=b21c09334335eab8a5d831a3aaaef1f6f9055d3c diff --git a/authorize.php b/authorize.php index 2a7e0a5..4275254 100644 --- a/authorize.php +++ b/authorize.php @@ -55,8 +55,8 @@ if (!count($errors)) { exit(); } - // Display an authorization form. - if (empty($_POST)) { + // Display an authorization form (unless the scope is email, which we always grant in this system). + if (empty($_POST) && (@$request->query['scope'] != 'email')) { $para = $body->appendElement('p', sprintf(_('Hi %s!'), $user['email'])); $para->setAttribute('class', 'userwelcome'); @@ -71,7 +71,7 @@ if (!count($errors)) { } else { // Handle authorize request, forwarding code in GET parameters if the user has authorized your client. - $is_authorized = ($_POST['authorized'] === 'yes'); + $is_authorized = (($_POST['authorized'] === 'yes') || ($request->query['scope'] == 'email')); $server->handleAuthorizeRequest($request, $response, $is_authorized); /* For testing only if ($is_authorized) {