tiddlyhost / tiddlyhost-com

Rails application for creating and hosting TiddlyWiki sites, plus resources for deploying it to https://tiddlyhost.com/
Other
184 stars 17 forks source link

[feature request] $:/status/IsLoggedIn set to yes when logged in #189

Closed Telumire closed 2 years ago

Telumire commented 2 years ago

Hi, since tiddlyhost does not use the password nor the pseudo in the TiddlySpot saver settings, $:/status/IsLoggedIn is missing even when logged in.

It would be handy to have this to be able to customize the wiki according to the current login status.

From the doc :

The tiddler $:/status/IsLoggedIn reflects the current login status with the values "yes" or "no", and $:/status/UserName reflects the current username.

Relevant :

simonbaird commented 2 years ago

Hmm, thanks for the suggestion. I think it would be easy to initialize it when the TW is first loaded. It might go stale after a while, e.g. if you logout in another tab, or if the login session times out, but I guess that doesn't matter much for the main use case, i.e. showing a public site in "read only" mode.

simonbaird commented 2 years ago

I pushed a build with this today.

Try it out, e.g

simonbaird commented 2 years ago

I didn't actually try to get a readonly mode working, but I assume it could be done.

Telumire commented 2 years ago

@simonbaird Yes, this works perfectly : https://read-only.tiddlyhost.com/#Disable%20read-only%20if%20user%20is%20logged%20in

Thanks a lot !

simonbaird commented 2 years ago

Cool!