use wcf\system\exception\IllegalLinkException;
use wcf\system\session\SessionHandler;
use wcf\system\WCF;
+use wcf\util\PasswordUtil;
use wcf\util\StringUtil;
/**
list($userID, $token) = explode('-', StringUtil::trim($_REQUEST['at']));
if (WCF::getUser()->userID) {
- if ($userID == WCF::getUser()->userID && WCF::getUser()->accessToken == $token) {
+ if ($userID == WCF::getUser()->userID && PasswordUtil::secureCompare(WCF::getUser()->accessToken, $token)) {
// everything is fine, but we are already logged in
return;
}
}
else {
$user = new User($userID);
- if ($user->accessToken == $token) {
+ if (PasswordUtil::secureCompare($user->accessToken, $token)) {
// token is valid -> change user
SessionHandler::getInstance()->changeUser($user, true);
}