mirror of
https://github.com/HeyPuter/puter.git
synced 2026-09-22 05:06:10 +00:00
Require login on app landing pages
Prevent first-time visitors from being treated as temporary users when they open an app landing page such as `/app/<name>` or `/desktop/app/<name>`. These routes now always go through the real login/signup flow.
This commit is contained in:
@@ -2003,9 +2003,12 @@ window.initgui = async function (options) {
|
||||
// -------------------------------------------------------------------------------------
|
||||
// Un-authed but not first visit -> try to log in/sign up
|
||||
// -------------------------------------------------------------------------------------
|
||||
// App landing pages (`/app/<name>`, incl. `/desktop/app/<name>`) require a
|
||||
// real account even on a first visit — never a temp user.
|
||||
const is_app_landing_page = window.url_paths[0] === 'app' && !!window.url_paths[1];
|
||||
if (
|
||||
!window.is_auth() &&
|
||||
(!window.first_visit_ever || window.disable_temp_users)
|
||||
(!window.first_visit_ever || window.disable_temp_users || is_app_landing_page)
|
||||
) {
|
||||
// `npm start --server=<remote>` serves this GUI locally while pointing
|
||||
// `gui_origin` at a remote Puter. There is nothing here to log into:
|
||||
|
||||
Reference in New Issue
Block a user