diff --git a/src/Umbraco.Web.UI.Client/src/apps/app/app-auth.controller.ts b/src/Umbraco.Web.UI.Client/src/apps/app/app-auth.controller.ts index baaceaf0a0..876a63fe03 100644 --- a/src/Umbraco.Web.UI.Client/src/apps/app/app-auth.controller.ts +++ b/src/Umbraco.Web.UI.Client/src/apps/app/app-auth.controller.ts @@ -74,6 +74,10 @@ export class UmbAppAuthController extends UmbControllerBase { // Figure out which providers are available const availableProviders = await firstValueFrom(this.#authContext.getAuthProviders()); + if (availableProviders.length === 0) { + throw new Error('[Fatal] No auth providers available'); + } + // If the user is timed out, we can show the login modal directly if (userLoginState === 'timedOut') { const selected = await this.#showLoginModal(userLoginState, availableProviders); @@ -85,10 +89,6 @@ export class UmbAppAuthController extends UmbControllerBase { return this.#updateState(); } - if (availableProviders.length === 0) { - throw new Error('[Fatal] No auth providers available'); - } - if (availableProviders.length === 1) { // One provider available (most likely the Umbraco provider), so initiate the authorization request to the default provider this.#authContext.makeAuthorizationRequest(availableProviders[0].forProviderName);