misuzu/public-legacy/auth/revert.php

23 lines
598 B
PHP
Raw Normal View History

2023-05-21 18:15:04 +00:00
<?php
namespace Misuzu;
use Misuzu\Auth\AuthTokenCookie;
if(CSRF::validateRequest()) {
$tokenInfo = $msz->authInfo->tokenInfo;
if($tokenInfo->hasImpersonatedUserId) {
$impUserId = $tokenInfo->impersonatedUserId;
2023-05-21 18:15:04 +00:00
$tokenBuilder = $tokenInfo->toBuilder();
$tokenBuilder->removeImpersonatedUserId();
$tokenInfo = $tokenBuilder->toInfo();
AuthTokenCookie::apply($tokenPacker->pack($tokenInfo));
Tools::redirect($msz->urls->format('manage-user', ['user' => $impUserId]));
return;
}
}
2023-05-21 18:15:04 +00:00
Tools::redirect($msz->urls->format('index'));