Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-30043 token.php should not return a mix of EXTERNAL_TOKEN_PERMANE…

…NT and EXTERNAL_TOKEN_EMBEDDED
  • Loading branch information...
commit 500ba8b11e17adcb477e152a644bf322779fda94 1 parent fae4f8f
@mouneyrac mouneyrac authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 login/token.php
View
4 login/token.php
@@ -94,9 +94,9 @@
// It does not really matter we take the first one that is valid.
$tokenssql = "SELECT t.id, t.sid, t.token, t.validuntil, t.iprestriction
FROM {external_tokens} t
- WHERE t.userid = ? AND t.externalserviceid = ?
+ WHERE t.userid = ? AND t.externalserviceid = ? AND t.tokentype = ?
ORDER BY t.timecreated ASC";
- $tokens = $DB->get_records_sql($tokenssql, array($user->id, $service->id));
+ $tokens = $DB->get_records_sql($tokenssql, array($user->id, $service->id, EXTERNAL_TOKEN_PERMANENT));
//A bit of sanity checks
foreach ($tokens as $key=>$token) {
Please sign in to comment.
Something went wrong with that request. Please try again.