Skip to content

Commit ff88216

Browse files
authored
Merge pull request #48 from topcoder-platform/issues-108
Issues-108:clear cache for Guests
2 parents 6eca399 + 98b05de commit ff88216

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Topcoder/class.topcoder.plugin.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,14 @@ public function gdn_auth_startAuthenticator_handler() {
274274
return;
275275
}
276276

277+
//TODO: https://github.com/topcoder-platform/forums/issues/108
278+
//Clear cache for Guests
279+
$userModel = new UserModel();
280+
self::log('Guest permissions:', ['IsCacheEnabled:' => Gdn::cache()->activeEnabled() , 'Permissions' => $userModel->getPermissions(0)]);
281+
// Delete cached data for userID=0 .
282+
$cacheCleared = $userModel->clearCache(0);
283+
self::log('After clearing cache for Guest:', ['IsCacheCleared' => $cacheCleared, 'Permissions' => $userModel->getPermissions(0)]);
284+
277285
if(!$this->isDefault()) {
278286
self::log('Topcoder Auth0 is not a default provider', []);
279287
return;

0 commit comments

Comments
 (0)