+// Temporary code to assign role_id to users who don't yet have it.
+if ($user->login && !$user->role_id) {
+ $user->migrateLegacyRole(); // Note: this requires initialized $i18n.
+ // Recycle User object, now with proper role_id.
+ $user = new ttUser(null, $auth->getUserId());
+}
+