check for available providers even earlier
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user