From 6fad083371f34eedcdc81f0976b2058e6fe8f774 Mon Sep 17 00:00:00 2001 From: Andrei Tuicu Date: Mon, 3 Mar 2025 18:38:11 +0100 Subject: [PATCH 1/2] fix: Give a warning when using Safari for CLI login --- src/server/HelixServer.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/server/HelixServer.js b/src/server/HelixServer.js index ea4163be6..268680457 100644 --- a/src/server/HelixServer.js +++ b/src/server/HelixServer.js @@ -47,6 +47,18 @@ export class HelixServer extends BaseServer { } async handleLogin(req, res) { + const userAgent = req.headers['user-agent']?.toLowerCase(); + if (userAgent?.includes('safari') && !userAgent?.includes('chrome')) { + res.status(403).send(` +

It looks like you are using Safari to login via the AEM CLI...

+

The login flow is not supported at the moment in Safari. You can follow the progress at the following Github issue.

+

Please use Google Chrome or Mozilla Firefox in the meantime for login.

+

You can use --no-open cli option to start the server without automatically opening the browser, in order to avoid changing your default browser.

+

Once you are logged in, the token is available for 24h and you can do the rest of your work in your favorite browser.

+`); + return; + } + // disable autologin if login was called at least once this._autoLogin = false; // clear any previous login errors From c6eb6203d3e5234dd17c911273c27d619cf7fe8b Mon Sep 17 00:00:00 2001 From: Andrei Tuicu Date: Mon, 3 Mar 2025 18:49:55 +0100 Subject: [PATCH 2/2] fix: Give a warning when using Safari for CLI login --- src/server/HelixServer.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/server/HelixServer.js b/src/server/HelixServer.js index 268680457..909a8e13d 100644 --- a/src/server/HelixServer.js +++ b/src/server/HelixServer.js @@ -51,9 +51,14 @@ export class HelixServer extends BaseServer { if (userAgent?.includes('safari') && !userAgent?.includes('chrome')) { res.status(403).send(`

It looks like you are using Safari to login via the AEM CLI...

-

The login flow is not supported at the moment in Safari. You can follow the progress at the following Github issue.

+

Unfortunately, the login flow is not supported at the moment in Safari. You can follow the progress at the following Github issue.

Please use Google Chrome or Mozilla Firefox in the meantime for login.

-

You can use --no-open cli option to start the server without automatically opening the browser, in order to avoid changing your default browser.

+

To avoid changing your default browser, you can:

+
    +
  1. Start the CLI with the --no-open option to avoid opening the browser automatically
  2. +
  3. Open Chrome or Firefox and login via the CLI
  4. +
  5. Close the CLI and start it again normally
  6. +

Once you are logged in, the token is available for 24h and you can do the rest of your work in your favorite browser.

`); return;