I read this blog on my own laptop more than anywhere else, because that is where it is written. Umbraco runs there, and the public site is exported from it as static files. When I spotted a mistake in a post on localhost, fixing it meant opening a new tab, going to /umbraco, logging in again if the session had run out, and finding the article in the content tree. I wanted a button on the page that goes straight to that page's editor, and that nobody else would ever see.
Nothing in the box does this
Umbraco has no such button. There are older community packages, uEditThis and Our.Umbraco.EditLink among them, that show an edit link while someone is logged in, and in Umbraco 14 and later a view can ask whether a backoffice user is signed in. Both answer whether you are logged in at this moment. The time I most want the button is after my session has expired, so the question I wanted asked was whether this browser has ever logged in.
How it decides
The package has two halves.
The first is a backoffice entry point, a few lines of JavaScript that Umbraco runs when the backoffice starts. The backoffice only starts after a successful login, so when this runs it sets a cookie on the site's domain:
document.cookie = `super_secret_login=1; Path=/; Max-Age=${60 * 60 * 24 * 400}; SameSite=Lax; Secure`;
It isn't Umbraco's session cookie, so logging out leaves it alone. Browsers won't keep a cookie for more than 400 days, so it is set again every time the backoffice opens.
The second half is a tag helper. Put this in the layout:
<super-secret-login-button />
and it renders the button only when that cookie comes with the request. Without the cookie the tag renders nothing: no hidden element, no script and no class name for anyone reading the source. On a content page the button links to that page in the backoffice editor.
The cookie is a hint and not a key. Anyone who sets it by hand gets a button that leads to the login screen every Umbraco site already has at /umbraco.
Why the public site never has it
stepinto.dev is static files, saved by a tool that asks the local site for every page. That tool sends no cookies, so every page it saves was rendered for a browser that has never logged in, and the button isn't in any of them. I added a check anyway: the export stops if the button's marker turns up in a page, so rendering it some other way by mistake fails the build instead of shipping a login button to readers.
So you won't find it by poking at this site. It only exists on my laptop. On an ordinary Umbraco site, where the backoffice and the pages share a domain, editors get it on the live site.
One warning for that case, which is in the README too. Anything that caches whole pages, such as output caching or a CDN, could store a copy with the button in it and hand it to everyone. Vary the cache on the cookie, or skip the cache for requests that carry it.
Trying it
The package is Umbraco.Community.SuperSecretLoginButton on NuGet, for Umbraco 17, with its source on GitHub under the MIT licence. It installs with:
dotnet add package Umbraco.Community.SuperSecretLoginButton
Add @addTagHelper *, Umbraco.Community.SuperSecretLoginButton to _ViewImports.cshtml, put the tag just before </body>, log in to the backoffice once and look at the site. The words on the button, the corner it sits in and where it links to can all be set on the tag.