mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-16 22:06:34 +00:00
Fix body stream already read error (#1646)
This commit is contained in:
parent
0d7979a72f
commit
7cf7763e21
@ -92,16 +92,14 @@ class HaAuthorize extends LocalizeLiteMixin(PolymerElement) {
|
|||||||
// Fetch auth providers
|
// Fetch auth providers
|
||||||
try {
|
try {
|
||||||
const response = await window.providersPromise;
|
const response = await window.providersPromise;
|
||||||
const result = await response.json();
|
const authProviders = await response.json();
|
||||||
|
|
||||||
// Forward to main screen which will redirect to right onboarding page.
|
// Forward to main screen which will redirect to right onboarding page.
|
||||||
if (response.status === 400 && result.code === 'onboarding_required') {
|
if (response.status === 400 && authProviders.code === 'onboarding_required') {
|
||||||
location.href = '/';
|
location.href = '/';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const authProviders = await response.json();
|
|
||||||
|
|
||||||
if (authProviders.length === 0) {
|
if (authProviders.length === 0) {
|
||||||
alert('No auth providers returned. Unable to finish login.');
|
alert('No auth providers returned. Unable to finish login.');
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user