diff --git a/src/server/HelixServer.js b/src/server/HelixServer.js index ea4163be6..909a8e13d 100644 --- a/src/server/HelixServer.js +++ b/src/server/HelixServer.js @@ -47,6 +47,23 @@ 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...

+

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.

+

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; + } + // disable autologin if login was called at least once this._autoLogin = false; // clear any previous login errors