Let's see what happens during returnToSuperAdmin: 1. Decode superAdminToken 2. localStorage.setItem('ctms_token', superAdminToken) 3. localStorage.setItem('ctms_user_id', payload.id) <-- u_71657ec7 4. localStorage.setItem('ctms_tenant_id', payload.tenant_id || 'system') <-- 'system' 5. window.location.reload() Then the app reloads. 1. AuthGuard mounts 2. const storedUserId = localStorage.getItem('ctms_user_id') <-- u_71657ec7 3. const fetchedUser = await getUserById(storedUserId) -> GET /api/users/u_71657ec7 Backend handles GET /api/users/u_71657ec7: req.user is derived from jwt.verify(superAdminToken) So req.user.role === 'super_admin' req.user.tenant_id === 'system' (or null) const [rows] = await pool.query('SELECT * FROM users WHERE id = ? OR slug = ?', [req.params.idOrSlug, req.params.idOrSlug]); if (rows.length === 0) return res.status(404).json({ error: 'Not found' }); if (req.user.role !== 'super_admin' && rows[0].tenant_id !== req.user.tenant_id) { ... } res.json(rows[0]); Wait. If this is a 500 error, why does it crash? What if `req.user` is undefined? But `authenticateToken` middleware ensures `req.user` exists. Maybe `pool.query` fails? No, wait. You said: "now its sending me to login page, congrats" Then I fixed the Base64 pad. Then you said: "i am still having this problem, when i go to impersionate the pages blink and i go to the tenant pages, good, but when i press to go back and stop impersionate it redirects me to the goddam login page" Then you said: "ok, its working but its giving some errors in dev tools and this errors is showing our users id and path ... XHRGET https://fasto.blyzer.com.br/api/users/u_71657ec7 [HTTP/2 500 14ms]" Why 500? Let's add a console.log in the catch block of `/users/:idOrSlug` to see the actual error.